Sha256: 53258d9eaa0ad9abac2e18b4727ef9f9871d73874a83eafc930744a37d059f14
Contents?: true
Size: 791 Bytes
Versions: 52
Compression:
Stored size: 791 Bytes
Contents
module CassandraObject module Dirty extend ActiveSupport::Concern include ActiveModel::Dirty # Attempts to +save+ the record and clears changed attributes if successful. def save(*) #:nodoc: if status = super @previously_changed = changes @changed_attributes.clear end status end # Attempts to <tt>save!</tt> the record and clears changed attributes if successful. def save!(*) #:nodoc: super.tap do @previously_changed = changes @changed_attributes.clear end end def write_attribute(name, value) name = name.to_s unless attribute_changed?(name) old = read_attribute(name) changed_attributes[name] = old if old != value end super end end end
Version data entries
52 entries across 52 versions & 2 rubygems