Sha256: 0984e82d390cc85341564a929ef63f86aa1fd3566f2314251519967671b86a90

Contents?: true

Size: 401 Bytes

Versions: 9

Compression:

Stored size: 401 Bytes

Contents

module ActiveModel
  module Dirty
    def attribute_was(attr)
      # CPK
      if self.composite? && attr == "id"
        self.class.primary_keys.map do |key_attr|
          attribute_changed?(key_attr) ? changed_attributes[key_attr] : self.ids_hash[key_attr]
        end
      else
        attribute_changed?(attr) ? changed_attributes[attr] : __send__(attr)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
composite_primary_keys-7.0.10 lib/composite_primary_keys/active_model/dirty.rb
composite_primary_keys-7.0.9 lib/composite_primary_keys/active_model/dirty.rb
composite_primary_keys-7.0.8 lib/composite_primary_keys/active_model/dirty.rb
composite_primary_keys-7.0.7 lib/composite_primary_keys/active_model/dirty.rb
composite_primary_keys-7.0.6 lib/composite_primary_keys/active_model/dirty.rb
composite_primary_keys-7.0.5 lib/composite_primary_keys/active_model/dirty.rb
composite_primary_keys-7.0.4 lib/composite_primary_keys/active_model/dirty.rb
composite_primary_keys-7.0.3 lib/composite_primary_keys/active_model/dirty.rb
composite_primary_keys-7.0.2 lib/composite_primary_keys/active_model/dirty.rb