summaryrefslogtreecommitdiff
path: root/UPGRADING.md
diff options
context:
space:
mode:
authorMichael Herold <michael.j.herold@gmail.com>2017-02-01 08:03:45 -0600
committerMichael Herold <michael.j.herold@gmail.com>2017-02-04 14:38:00 -0600
commitb2f94a486650587573fea808cf0b1dbb06bc57e5 (patch)
tree5c1c075c9be1523b62c94a3a107b9051bbcd400a /UPGRADING.md
parent24caf3564e3073c68227590e72bf43e0a604ac68 (diff)
downloadhashie-b2f94a486650587573fea808cf0b1dbb06bc57e5.tar.gz
Allow Mash subclasses to disable warnings
Since we are transitively used as a dependency in many projects, we should have given the ability to toggle this behavior off. The logging feature is more of a "help people get started with Mash" feature. If you're using Hashie in a library, it's likely that you already know the tradeoffs of attempting to override methods on the object. To use this feature, you only have to subclass Mash and then call the class method: ```ruby class KeyStore < Hashie::Mash disable_warnings end ```
Diffstat (limited to 'UPGRADING.md')
-rw-r--r--UPGRADING.md15
1 files changed, 14 insertions, 1 deletions
diff --git a/UPGRADING.md b/UPGRADING.md
index a6334a1..5a9f05a 100644
--- a/UPGRADING.md
+++ b/UPGRADING.md
@@ -1,6 +1,19 @@
Upgrading Hashie
================
+### Upgrading to 3.5.2
+
+#### Disable logging in Mash subclasses
+
+If you subclass `Hashie::Mash`, you can now disable the logging we do about
+overriding existing methods with keys. This looks like:
+
+```ruby
+class MyMash < Hashie::Mash
+ disable_warnings
+end
+```
+
### Upgrading to 3.4.7
#### Procs as default values for Dash
@@ -11,7 +24,7 @@ class MyHash < Hashie::Dash
end
```
-In versions < 3.4.7 `Time.now` will be evaluated when `time` property is accessed directly first time.
+In versions < 3.4.7 `Time.now` will be evaluated when `time` property is accessed directly first time.
In version >= 3.4.7 `Time.now` is evaluated in time of object initialization.
### Upgrading to 3.4.4