Class: Syncano::ActiveRecord::Association::HasOne
- Defined in:
- lib/syncano/active_record/association/has_one.rb
Overview
Class for has one association
Instance Attribute Summary collapse
-
#associated_model ⇒ Object
readonly
Returns the value of attribute associated_model.
-
#foreign_key ⇒ Object
readonly
Returns the value of attribute foreign_key.
-
#source_model ⇒ Object
readonly
Returns the value of attribute source_model.
Instance Method Summary collapse
-
#has_one? ⇒ TrueClass
Checks if association is has_one type.
Methods inherited from Base
#belongs_to?, #has_many?, #initialize
Constructor Details
This class inherits a constructor from Syncano::ActiveRecord::Association::Base
Instance Attribute Details
#associated_model ⇒ Object
Returns the value of attribute associated_model.
8 9 10 |
# File 'lib/syncano/active_record/association/has_one.rb', line 8 def associated_model @associated_model end |
#foreign_key ⇒ Object
Returns the value of attribute foreign_key.
8 9 10 |
# File 'lib/syncano/active_record/association/has_one.rb', line 8 def foreign_key @foreign_key end |
#source_model ⇒ Object
Returns the value of attribute source_model.
8 9 10 |
# File 'lib/syncano/active_record/association/has_one.rb', line 8 def source_model @source_model end |
Instance Method Details
#has_one? ⇒ TrueClass
Checks if association is has_one type
12 13 14 |
# File 'lib/syncano/active_record/association/has_one.rb', line 12 def has_one? true end |