Sha256: 3de292f53ca94717f6b01d41c0c46c6876b251696a117c31c9fe24df5e1bd57a

Contents?: true

Size: 488 Bytes

Versions: 10

Compression:

Stored size: 488 Bytes

Contents

module Ardm
  module ActiveRecord
    module Dirty
      def dirty?
        changed?
      end

      def dirty_attributes
        changes.inject({}) do |memo, (attr, val)|
          property = properties[attr]
          memo[property] = val
          memo
        end
      end

      def method_missing(meth, *args, &block)
        if meth.to_s =~ /^([\w_]+)_dirty\?$/
          send("#{$1}_changed?", *args, &block)
        else
          super
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ardm-0.2.7 lib/ardm/active_record/dirty.rb
ardm-0.2.6 lib/ardm/active_record/dirty.rb
ardm-0.2.5 lib/ardm/active_record/dirty.rb
ardm-0.2.4 lib/ardm/active_record/dirty.rb
ardm-0.2.3 lib/ardm/active_record/dirty.rb
ardm-0.2.2 lib/ardm/active_record/dirty.rb
ardm-0.2.1 lib/ardm/active_record/dirty.rb
ardm-0.2.0 lib/ardm/active_record/dirty.rb
ardm-0.1.0 lib/ardm/active_record/dirty.rb
ardm-0.0.1 lib/ardm/active_record/dirty.rb