Module: ObservationMatrixColumnsHelper

Defined in:
app/helpers/observation_matrix_columns_helper.rb

Instance Method Summary collapse

Instance Method Details

#observation_matrix_column_destroyable?(observation_matrix_column) ⇒ ObservationMatrixColumn#id?

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

Returns:

  • (ObservationMatrixColumn#id, nil)

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



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

def observation_matrix_column_destroyable?(observation_matrix_column)
  if !observation_matrix_column.cached_observation_matrix_column_item_id.blank? && observation_matrix_column.reference_count == 1
    return observation_matrix_column.cached_observation_matrix_column_item_id
  end
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

#observation_matrix_column_tag(matrix_column) ⇒ Object



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