5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-07-03 23:45:45 +00:00

limpiar tambien los hashes

This commit is contained in:
f 2018-06-27 19:26:33 -03:00
parent 8406681469
commit ae8856334c
No known key found for this signature in database
GPG key ID: F3FDAB97B5F9F7E7

View file

@ -199,7 +199,9 @@ class Post
# HashWithIndifferentAccess
attrs = attrs.to_h.map do |k,v|
t = template_fields.find { |t| t.key == k }
v = v.values.map(&:to_h) if t && t.nested? && t.array?
if t && t.nested?
v = t.array? ? v.values.map(&:to_h) : v.to_h
end
{ k => v }
end.reduce(Hash.new, :merge).stringify_keys