Commit d9b312c2 by ivan Lan

Fix the spec unchange issue, which will happen when the hash still the same but order changed.

parent fdd814c9
...@@ -16,6 +16,7 @@ module Shotengai ...@@ -16,6 +16,7 @@ module Shotengai
define_method("#{column}_input=") do |val| define_method("#{column}_input=") do |val|
parsed_val = val && val.map{ |h| { (h[:key] || h['key']) => (h[:val] || h['val']) } }.reduce(&:merge) parsed_val = val && val.map{ |h| { (h[:key] || h['key']) => (h[:val] || h['val']) } }.reduce(&:merge)
self.#{column} = parsed_val self.#{column} = parsed_val
self.#{column}_will_change!
end end
define_method("#{column}_output") do define_method("#{column}_output") do
...@@ -59,4 +60,4 @@ module Shotengai ...@@ -59,4 +60,4 @@ module Shotengai
end end
end end
end end
end end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment