rails--rails/activemodel/CHANGELOG.md

24 lines
760 B
Markdown
Raw Normal View History

* Raise FrozenError when trying to write attributes that aren't backed by the database on an object that is frozen:
class Animal
2019-11-24 00:20:00 +00:00
include ActiveModel::Attributes
attribute :age
end
2019-11-24 00:20:00 +00:00
animal = Animal.new
2019-11-24 00:20:00 +00:00
animal.freeze
animal.age = 25 # => FrozenError, "can't modify a frozen Animal"
2019-11-24 00:20:00 +00:00
*Josh Brody*
* Add *_previously_was attribute methods when dirty tracking. Example:
pirate.update(catchphrase: "Ahoy!")
pirate.previous_changes["catchphrase"] # => ["Thar She Blows!", "Ahoy!"]
pirate.catchphrase_previously_was # => "Thar She Blows!"
*DHH*
2019-11-24 00:20:00 +00:00
2019-04-24 19:57:14 +00:00
Please check [6-0-stable](https://github.com/rails/rails/blob/6-0-stable/activemodel/CHANGELOG.md) for previous changes.