Module: ObservationMatrixRowsHelper

Defined in:
app/helpers/observation_matrix_rows_helper.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) get_observation_matrix_row_name(observation_matrix_row)



13
14
15
# File 'app/helpers/observation_matrix_rows_helper.rb', line 13

def get_observation_matrix_row_name(observation_matrix_row)
  object_tag(observation_matrix_row.row_object)
end

- (Id?) observation_matrix_row_destroyable?(observation_matrix_row)

Returns if destroyable (represented by only a single OMRI of type Single) then return the ID

Returns:

  • (Id, nil)

    if destroyable (represented by only a single OMRI of type Single) then return the ID



19
20
21
22
23
24
# File 'app/helpers/observation_matrix_rows_helper.rb', line 19

def observation_matrix_row_destroyable?(observation_matrix_row)
  if !observation_matrix_row.cached_observation_matrix_row_item_id.blank?
    return observation_matrix_row.id if observation_matrix_row.reference_count == 1
  end
  nil 
end


8
9
10
11
# File 'app/helpers/observation_matrix_rows_helper.rb', line 8

def observation_matrix_row_link(observation_matrix_row)
  return nil if observation_matrix_row.nil?
  link_to(observation_matrix_row_tag(observation_matrix_row).html_safe, observation_matrix_row)
end

- (Object) observation_matrix_row_tag(observation_matrix_row)



3
4
5
6
# File 'app/helpers/observation_matrix_rows_helper.rb', line 3

def observation_matrix_row_tag(observation_matrix_row)
  return nil if observation_matrix_row.nil?
  get_observation_matrix_row_name(observation_matrix_row)
end