File tree Expand file tree Collapse file tree 1 file changed +1
-17
lines changed
app/services/runtimes/data_types Expand file tree Collapse file tree 1 file changed +1
-17
lines changed Original file line number Diff line number Diff line change @@ -158,24 +158,8 @@ def find_data_type(identifier, t)
158158 def update_rules ( rules , data_type )
159159 db_rules = data_type . rules . first ( rules . length )
160160 rules . each_with_index do |rule , index |
161- config = rule . rule_config . to_h . transform_values do |value |
162- next value unless value . is_a? ( Hash )
163-
164- data_type_identifier = value [ :data_type_identifier ]
165- generic_key = value [ :generic_key ]
166-
167- next value if data_type_identifier . nil? || generic_key . nil? # return the old thing if neither is present
168- next data_type_identifier unless data_type_identifier . empty? # return data_type_identifier if it's present
169- next { generic_key : generic_key } if generic_key . present? # return generic_key if it's present
170-
171- next { generic_type : value [ :generic_type ] }
172- end
173-
174161 db_rules [ index ] ||= DataTypeRule . new
175- db_rules [ index ] . assign_attributes (
176- variant : rule . variant . to_s . downcase ,
177- config : config
178- )
162+ db_rules [ index ] . assign_attributes ( variant : rule . variant . to_s . downcase , config : rule . rule_config . to_h )
179163 end
180164
181165 db_rules
You can’t perform that action at this time.
0 commit comments