Sha256: 996e62e094a8e946f809dfa9bad2ea49e8eee649e1f7011195648f4594b7e868
Contents?: true
Size: 915 Bytes
Versions: 21
Compression:
Stored size: 915 Bytes
Contents
module ActiveRecord module AttributeMethods module PrimaryKey # Returns the primary key previous value. def id_was sync_with_transaction_state # CPK # attribute_was(self.class.primary_key) if self.composite? self.class.primary_keys.map do |key_attr| attribute_changed?(key_attr) ? changed_attributes[key_attr] : self.ids_hash[key_attr] end else attribute_was(self.class.primary_key) end end def id_in_database sync_with_transaction_state # CPK # attribute_in_database(self.class.primary_key) if self.composite? self.class.primary_keys.map do |key_attr| attribute_in_database(key_attr) end else attribute_in_database(self.class.primary_key) end end end end end
Version data entries
21 entries across 21 versions & 1 rubygems