Skip to content

Commit

Permalink
Merge pull request #420 from ayuki-joto/feature/add-replace--null
Browse files Browse the repository at this point in the history
feat: add replace to null decidim_organization command
  • Loading branch information
ayuki-joto authored Sep 9, 2022
2 parents 5541217 + d1a5f7b commit 8b201a6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/tasks/replace_to_null.rake
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,15 @@ namespace :replace_to_null do
task decidim_assemblies_announcement: :environment do
Decidim::Assembly.update_all(announcement: nil) # rubocop:disable Rails/SkipsModelValidations
end

desc 'fix organization edit bug.Make all "" columns of decidim_assemblies table null'
task decidim_organization: :environment do
Decidim::Organization.transaction do
Decidim::Organization.all.each do |org|
org.description = nil if org.description == ""
org.highlighted_content_banner_short_description = nil if org.highlighted_content_banner_short_description == ""
org.save!
end
end
end
end

0 comments on commit 8b201a6

Please sign in to comment.