Skip to content

Commit

Permalink
Reversing importable commit changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kaskranenburgQ committed Oct 14, 2024
1 parent 2c0cb19 commit 6960d0e
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions app/services/csv_importer/importable_commit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,12 @@ def build_commit(dataset, row)
@keys.each do |key|
value = row[key]

# Use the custom `find` method which expects a key
current_attr = current.find(key)

if value
if current_attr
if value != current_attr.value
commit.dataset_edits.build(key: key, value: value)
end
else
# Log a warning if the key is not found in editable_attributes
warn "Warning: Key '#{key}' not found in editable_attributes for dataset '#{dataset.geo_id}'. Skipping this key."
end
if value && value != current.find(key).value
commit.dataset_edits.build(key: key, value: value)
end
end

commit
end
end
end
end

0 comments on commit 6960d0e

Please sign in to comment.