Module: ArelDateScopes::ArelAttributeEmulation
- Included in:
- Arel::Nodes::DayOfMonth, Arel::Nodes::Month, Arel::Nodes::Year
- Defined in:
- lib/arel_date_scopes/arel.rb
Overview
Workaround for Rails. Rails tries to threat left operands of == as Attribute object, but it can be a function like YEAR(). Fake #name should return “#field_#function” to resolve field conflicts.
Instance Method Summary collapse
Instance Method Details
#name ⇒ Object
7 |
# File 'lib/arel_date_scopes/arel.rb', line 7 def name; self.expressions.first.name.to_s + '_' + self.class.name.underscore; end |
#relation ⇒ Object
8 |
# File 'lib/arel_date_scopes/arel.rb', line 8 def relation; self.expressions.first; end |