Module: ObservationMatrixColumnsHelper

Defined in:
app/helpers/observation_matrix_columns_helper.rb

Instance Method Summary (collapse)

Instance Method Details

- (Id?) observation_matrix_column_destroyable?(observation_matrix_column)

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



16
17
18
19
20
21
# File 'app/helpers/observation_matrix_columns_helper.rb', line 16

def observation_matrix_column_destroyable?(observation_matrix_column)
  if !observation_matrix_column.cached_observation_matrix_column_item_id.blank?
    return observation_matrix_column.id if observation_matrix_column.reference_count == 1
  end
  nil
end


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

def observation_matrix_column_link(matrix_column)
  return nil if matrix_column.nil?
  link_to(observation_matrix_column_tag(matrix_column).html_safe, matrix_column)
end

- (Object) observation_matrix_column_tag(matrix_column)



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

def observation_matrix_column_tag(matrix_column)
  return nil if matrix_column.nil?
  matrix_column.descriptor.name
end