Skip to content

Commit

Permalink
Fix attachment title migration generating possibly invalid values (de…
Browse files Browse the repository at this point in the history
  • Loading branch information
ahukkanen committed May 24, 2021
1 parent 6a03e43 commit 28b2e4d
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,11 @@ def up
Decidim.default_locale

# rubocop:disable Rails/SkipsModelValidations
attachment.update_columns(
title: {
locale => attachment.title
},
description: {
locale => attachment.description
}
)
values = {}
values[:title] = { locale => attachment.title } unless attachment.title.is_a?(Hash)
values[:description] = { locale => attachment.description } unless attachment.description.is_a?(Hash)

attachment.update_columns(values)
# rubocop:enable Rails/SkipsModelValidations
end
end
Expand Down

0 comments on commit 28b2e4d

Please sign in to comment.