Class: Superstore::Associations::HasOne
- Inherits:
-
Association
- Object
- Association
- Superstore::Associations::HasOne
- Defined in:
- lib/superstore/associations/has_one.rb
Instance Attribute Summary
Attributes inherited from Association
Instance Method Summary collapse
Methods inherited from Association
#association_class, #association_class_name, #initialize, #loaded!, #loaded?, #reset, #target, #target=
Constructor Details
This class inherits a constructor from Superstore::Associations::Association
Instance Method Details
#reader ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/superstore/associations/has_one.rb', line 4 def reader unless loaded? self.target = load_target end target end |
#writer(record) ⇒ Object
12 13 14 |
# File 'lib/superstore/associations/has_one.rb', line 12 def writer(record) self.target = record end |