Class: DatastaxRails::Associations::BelongsToAssociation
- Inherits:
-
SingularAssociation
- Object
- Association
- SingularAssociation
- DatastaxRails::Associations::BelongsToAssociation
- Defined in:
- lib/datastax_rails/associations/belongs_to_association.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#updated ⇒ Object
(also: #updated?)
readonly
Returns the value of attribute updated.
Attributes inherited from Association
#loaded, #owner, #reflection, #target
Instance Method Summary collapse
Methods inherited from SingularAssociation
#build, #create, #create!, #reader, #writer
Methods inherited from Association
#aliased_column_family, #association_scope, #initialize, #klass, #load_target, #loaded!, #reload, #reset, #reset_scope, #scoped, #set_inverse_instance, #stale_target?, #target_scope
Constructor Details
This class inherits a constructor from DatastaxRails::Associations::Association
Instance Attribute Details
#updated ⇒ Object (readonly) Also known as: updated?
Returns the value of attribute updated.
4 5 6 |
# File 'lib/datastax_rails/associations/belongs_to_association.rb', line 4 def updated @updated end |
Instance Method Details
#replace(record) ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/datastax_rails/associations/belongs_to_association.rb', line 6 def replace(record) raise_on_type_mismatch(record) if record replace_keys(record) set_inverse_instance(record) @updated = true if record self.target = record end |