Module: MR::FakeRecord::Associations::InstanceMethods
- Defined in:
- lib/mr/fake_record/associations.rb
Instance Method Summary collapse
-
#association(name) ⇒ Object
ActiveRecord methods.
Instance Method Details
#association(name) ⇒ Object
ActiveRecord methods
51 52 53 54 55 56 57 |
# File 'lib/mr/fake_record/associations.rb', line 51 def association(name) @association_cache ||= {} @association_cache[name.to_sym] ||= begin reflection = self.class.reflections.find(name) reflection.association_class.new(self, reflection) end end |