Commit 973f5adb by liyijie

feat: try_chain支持hash with symbol

parent 4b85bd1a
......@@ -203,7 +203,7 @@ module TalltyImportExport
end
def try_chain record, arr
arr.reduce(record) { |r, m| r.try(m) || r.try(:[], m) }
arr.reduce(record) { |r, m| r.try(m) || r.try(:[], m) || r.try(:[], m.to_sym) }
end
def try_method record, method
......
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