Module: CassandraObject::AttributeMethods::Dirty

Extended by:
ActiveSupport::Concern
Includes:
ActiveModel::Dirty
Included in:
Base
Defined in:
lib/cassandra_object/attribute_methods/dirty.rb

Instance Method Summary collapse

Instance Method Details

#reloadObject

reload the record and clears changed attributes.



15
16
17
18
19
# File 'lib/cassandra_object/attribute_methods/dirty.rb', line 15

def reload
  super
  clear_changes_information
  self
end

#saveObject

Attempts to save the record and clears changed attributes if successful.



8
9
10
11
12
# File 'lib/cassandra_object/attribute_methods/dirty.rb', line 8

def save(*) #:nodoc:
  status = super
  changes_applied
  status
end

#write_attribute(name, value) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/cassandra_object/attribute_methods/dirty.rb', line 21

def write_attribute(name, value)
  name = name.to_s
  old = read_attribute(name)

  self.send("#{name}_will_change!") unless value == old
  super
end