mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-15 04:11:41 +00:00
limpiar tambien los hashes
This commit is contained in:
parent
8406681469
commit
ae8856334c
1 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue