module ActiveRecord::AttributeMethods::PrimaryKey

def id_was

Returns the primary key column's previous value.
def id_was
  attribute_was(@primary_key)
end