Class: ActiveAny::Associations::BelongsToAssociation
- Inherits:
-
Association
- Object
- Association
- ActiveAny::Associations::BelongsToAssociation
- Defined in:
- lib/active_any/associations/belongs_to_association.rb
Instance Attribute Summary
Attributes inherited from Association
#inversed, #loaded, #owner, #reflection, #target
Instance Method Summary collapse
Methods inherited from Association
#association_scope, #find_from_target?, #initialize, #klass, #load_target, #loaded!, #loaded?, #reload, #reset, #reset_scope, #scope, #set_inverse_instance, #target_scope
Constructor Details
This class inherits a constructor from ActiveAny::Associations::Association
Instance Method Details
#find_target ⇒ Object
16 17 18 |
# File 'lib/active_any/associations/belongs_to_association.rb', line 16 def find_target scope.first end |
#reader ⇒ Object
6 7 8 9 10 |
# File 'lib/active_any/associations/belongs_to_association.rb', line 6 def reader reload unless loaded? target end |
#writer(_records) ⇒ Object
12 13 14 |
# File 'lib/active_any/associations/belongs_to_association.rb', line 12 def writer(_records) raise NotImplementedError.new, 'writer is unimplemented' end |