Module: ActiveRecord::Associations::ClassMethods
- Defined in:
- lib/criteria.rb
Instance Method Summary collapse
- #__criteria_belongs_to(id, opts = {}) ⇒ Object (also: #belongs_to)
- #__criteria_has_many(id, opts = {}, &block) ⇒ Object (also: #has_many)
Instance Method Details
#__criteria_belongs_to(id, opts = {}) ⇒ Object Also known as: belongs_to
586 587 588 589 590 |
# File 'lib/criteria.rb', line 586 def __criteria_belongs_to(id, opts={}) # puts "#{self} belongs to #{id} with #{opts.inspect}" self.many_to_one_associations << id __ar_belongs_to(id, opts) end |
#__criteria_has_many(id, opts = {}, &block) ⇒ Object Also known as: has_many
595 596 597 598 599 |
# File 'lib/criteria.rb', line 595 def __criteria_has_many(id, opts={}, &block) # puts "#{self} has many #{id} with #{opts.inspect}" self.one_to_many_associations << id __ar_has_many(id, opts, &block) end |