Skip to content

Instantly share code, notes, and snippets.

@jgigault
Created March 6, 2020 10:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgigault/f12dbfafa73e1a24fddc2a64f6223432 to your computer and use it in GitHub Desktop.
Save jgigault/f12dbfafa73e1a24fddc2a64f6223432 to your computer and use it in GitHub Desktop.
PaperTrail.request.whodunnit = User.find_by!(email: 'admin@per-angusta.com').id
Supplier.all.each do |s|
metadata = s.metadata
next if !metadata.key?('ecovadis')
metadata.delete('ecovadis')
s.save!(validate: false)
end
active_third_party_client = ThirdPartyClient.active.find_by_identifier(:ecovadis)
active_third_party_client_config = active_third_party_client.third_party_client_config
active_third_party_client_config.metadata['status_last_update'] = '1998-01-01'
active_third_party_client_config.save!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment