Sha256: 7a6daf413075240288abea59cb4f1285a4f9d948f0049673dcbfd5c7e8245a28
Contents?: true
Size: 458 Bytes
Versions: 4
Compression:
Stored size: 458 Bytes
Contents
module ActiveModel module Dirty def can_change_primary_key? true end def primary_key_changed? !!changed.detect { |key| ids_hash.keys.include?(key.to_s) } end def primary_key_was ids_hash.keys.inject(Hash.new) do |result, attribute_name| result[attribute_name] = attribute_was(attribute_name.to_s) result end end alias_method :ids_hash_was, :primary_key_was end end
Version data entries
4 entries across 4 versions & 1 rubygems