1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activemodel/CHANGELOG.md
Tejas Dinkar da2b05bb6b Allows you to check if an attribute has changed to a particular value
model.name_changed?(from: "Pete", to: "Ringo")
2013-12-15 12:13:31 +05:30

1.5 KiB

  • attribute_changed? now accepts parameters which check the old and new value of the attribute

    model.name_changed?(from: "Pete", to: "Ringo")

    Tejas Dinkar

  • Fix has_secure_password to honor bcrypt-ruby's cost attribute.

    T.J. Schuck

  • Updated the ActiveModel::Dirty#changed_attributes method to be indifferent between using symbols and strings as keys.

    William Myers

  • Added new API methods reset_changes and changes_applied to ActiveModel::Dirty that control changes state. Previsously you needed to update internal instance variables, but now API methods are available.

    Bogdan Gusiev

  • Fix has_secure_password. password_confirmation validations are triggered even if no password_confirmation is set.

    Vladimir Kiselev

  • inclusion / exclusion validations with ranges will only use the faster Range#cover for numerical ranges, and the more accurate Range#include? for non-numerical ones.

    Fixes range validations like :a..:f that used to pass with values like :be. Fixes #10593.

    Charles Bergeron

  • Fix regression in has_secure_password. When a password is set, but a confirmation is an empty string, it would incorrectly save.

    Steve Klabnik and Phillip Calvin

  • Deprecate Validator#setup. This should be done manually now in the validator's constructor.

    Nick Sutterer

Please check 4-0-stable for previous changes.