document_hash 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -43,13 +43,14 @@ module DocumentHash
43
43
  end
44
44
 
45
45
  def merge other
46
- self.class.symbolize_keys other
47
- super other
46
+ dup.merge! other
48
47
  end
49
48
 
50
49
  def merge! other
51
50
  self.class.symbolize_keys other
51
+ other = Hash[ other.collect{ |k, v| [ k, execute_before_change_callback(k,v) ] } ]
52
52
  super other
53
+ other.each { |k, v| changed_key k,v }
53
54
  end
54
55
 
55
56
  private
@@ -69,7 +70,6 @@ module DocumentHash
69
70
 
70
71
  value = @before_change.call path, value if @before_change
71
72
  value = parent.__send__ :execute_before_change_callback, path.unshift(parent_key), value if parent
72
-
73
73
  value
74
74
  end
75
75
 
@@ -1,3 +1,3 @@
1
1
  module DocumentHash
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: document_hash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: