diff options
author | Max Lincoln <max@devopsy.com> | 2014-08-17 12:10:10 -0400 |
---|---|---|
committer | Max Lincoln <max@devopsy.com> | 2014-08-17 12:32:27 -0400 |
commit | 404d52f4d7dec6d02f7286ecfc8d576b959bfa2b (patch) | |
tree | 877a93774f39fbad355d2eb318a775e960dd65db /UPGRADING.md | |
parent | 0dc1b7cdb341c4de87f573c1ccef6541bb31a5eb (diff) | |
download | hashie-404d52f4d7dec6d02f7286ecfc8d576b959bfa2b.tar.gz |
doc updates
Diffstat (limited to 'UPGRADING.md')
-rw-r--r-- | UPGRADING.md | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/UPGRADING.md b/UPGRADING.md index 611d307..25e8a84 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -1,6 +1,22 @@ Upgrading Hashie ================ +### Upgrading to 3.2.1 + +#### Possible coercion changes + +The improvements made to coercions in version 3.2.1 [issue #200](https://github.com/intridea/hashie/pull/200) do not break the documented API, but are significant enough that changes may effect undocumented side-effects. Applications that depended on those side-effects will need to be updated. + +**Change**: Type coercion no longer creates new objects if the input matches the target type. Previously coerced properties always resulted in the creation of a new object, even when it wasn't necessary. This had the effect of a `dup` or `clone` on coerced properties but not uncoerced ones. + +If necessary, `dup` or `clone` your own objects. Do not assume Hashie will do it for you. + +**Change**: Failed coercion attempts now raise Hashie::CoercionError. + +Hashie now raises a Hashie::CoercionError that details on the property that could not be coerced, the source and target type of the coercion, and the internal error. Previously only the internal error was raised. + +Applications that were attempting to rescuing the internal errors should be updated to rescue Hashie::CoercionError instead. + ### Upgrading to 3.0 #### Compatibility with Rails 4 Strong Parameters |