Sha256: cd0cfe2e5696ba087119af1723e2ee399291cf5f9efe6ea1732f11382327cb4c

Contents?: true

Size: 594 Bytes

Versions: 6

Compression:

Stored size: 594 Bytes

Contents

class Acfs::Resource
  #
  # Thin wrapper around ActiveModel::Dirty
  #
  module Dirty
    extend ActiveSupport::Concern
    include ActiveModel::Dirty

    # @api private
    #
    def reset_changes
      clear_changes_information
    end

    # @api private
    #
    def save!(*)
      super.tap {|_| changes_applied }
    end

    # @api private
    #
    def loaded!
      reset_changes
      super
    end

    # @api private
    #
    def write_raw_attribute(name, value, opts = {})
      attribute_will_change!(name) if opts[:change].nil? || opts[:change]
      super
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
acfs-1.3.2 lib/acfs/resource/dirty.rb
acfs-1.3.1 lib/acfs/resource/dirty.rb
acfs-1.3.0 lib/acfs/resource/dirty.rb
acfs-1.2.1 lib/acfs/resource/dirty.rb
acfs-0.50.0 lib/acfs/resource/dirty.rb
acfs-1.2.0 lib/acfs/resource/dirty.rb