Fix bug in ruby 2.7.

This commit is contained in:
邱博亞 2023-12-19 22:50:07 +08:00
parent 6dddde451d
commit 5d7769270a
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@
end end
fields_name = fields_name - basic_keys fields_name = fields_name - basic_keys
keys = basic_keys + fields_name keys = basic_keys + fields_name
keys = keys.select{|field_name| (property[field_name]["enable"] == "1" rescue true) } keys = keys.select{|field_name| tmp = property[field_name]; (tmp.is_a?(Hash) ? (tmp["enable"] == "1") : true) }
p_hire_fields = property.p_hire_fields_enabled.map{|rf| [rf.id.to_s,rf]}.to_h p_hire_fields = property.p_hire_fields_enabled.map{|rf| [rf.id.to_s,rf]}.to_h
has_p_hire_fields = p_hire_fields.count != 0 has_p_hire_fields = p_hire_fields.count != 0
tmp_keys = [] tmp_keys = []