-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add yesterdays_description, todays_description, and blockers to standup_meeting_params * Add rich text associations for yesterdays_description, todays_description, and blockers to StandupMeeting model * adds rich_text_are fields to form * pass new content_type that maps to new rich text associations * Add trix-context class to rich_text_areas * restore has_rich_text previous naming * remove added params * Add task to migrate standup meeting data to action text
- Loading branch information
Showing
3 changed files
with
37 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
namespace :standup_meeting do | ||
desc 'Migrate standup meeting data to action text' | ||
|
||
task migrate_data_to_action_text: :environment do | ||
failed_updates = [] | ||
|
||
StandupMeeting.where(status: 'completed').find_each do |meeting| | ||
meeting.update!( | ||
today_work_description: meeting.read_attribute_before_type_cast(:today_work_description), | ||
yesterday_work_description: meeting.read_attribute_before_type_cast(:yesterday_work_description), | ||
blockers_description: meeting.read_attribute_before_type_cast(:blockers_description) | ||
) | ||
rescue StandardError => e | ||
failed_updates << { id: meeting.id, error: e.message } | ||
Rails.logger.error "Migration failed for StandupMeeting id: #{meeting.id}, error: #{e.message}" | ||
end | ||
|
||
if failed_updates.any? | ||
puts "Migration completed with some failures: #{failed_updates.size} failed updates." | ||
Rails.logger.error "Failed updates: #{failed_updates.inspect}" | ||
else | ||
puts 'StandupMeeting data migration to action text is complete.' | ||
end | ||
end | ||
end |