Module: Shared::AlternateValues::ClassMethods

Defined in:
app/models/concerns/shared/alternate_values.rb

Instance Method Summary collapse

Instance Method Details

#with_alternate_value_on(a, b) ⇒ Object

Use

Otu.with_alternate_value_on(:name, 'foo')


15
16
17
# File 'app/models/concerns/shared/alternate_values.rb', line 15

def with_alternate_value_on(a, b)
  joins{alternate_values.outer}.where{(alternate_values.alternate_object_attribute == "#{a}") & (alternate_values.value == "#{b}")} # } # .references(:alternate_values) # 'alternate_values' => {'alternate_object_attribute' => attribute, 'value' => value})
end