Sha256: d05f057468f490571d51d756de118682ac43fa52cc7c725c1a655a9f0b0eae46
Contents?: true
Size: 597 Bytes
Versions: 10
Compression:
Stored size: 597 Bytes
Contents
module Toy module DirtyStore extend ActiveSupport::Concern include ActiveModel::Dirty include Reloadable include Persistence include Querying def initialize_from_database(*) super @previously_changed = {} @changed_attributes.clear if @changed_attributes self end def reload super.tap do @previously_changed = {} @changed_attributes = {} end end def save(*) super.tap do @previously_changed = changes @changed_attributes.clear if @changed_attributes end end end end
Version data entries
10 entries across 10 versions & 1 rubygems