Commit 87b2b5115330df24d4d3ae271e9b7ae809206e26
1 parent
cae32b51
Exists in
rails5
rails5: upgrade #update_all
Showing
3 changed files
with
2 additions
and
3 deletions
Show diff stats
db/migrate/20100920182433_change_action_tracker_record.rb
@@ -2,7 +2,7 @@ class ChangeActionTrackerRecord < ActiveRecord::Migration | @@ -2,7 +2,7 @@ class ChangeActionTrackerRecord < ActiveRecord::Migration | ||
2 | def self.up | 2 | def self.up |
3 | rename_column(:action_tracker, :dispatcher_type, :target_type) | 3 | rename_column(:action_tracker, :dispatcher_type, :target_type) |
4 | rename_column(:action_tracker, :dispatcher_id, :target_id) | 4 | rename_column(:action_tracker, :dispatcher_id, :target_id) |
5 | - ActionTracker:Record.where(verb: 'publish_article_in_community').update_all verb: 'create_article' | 5 | + ActionTracker::Record.where(verb: 'publish_article_in_community').update_all verb: 'create_article' |
6 | end | 6 | end |
7 | 7 | ||
8 | def self.down | 8 | def self.down |
db/migrate/20131011164400_add_spam_to_task.rb
@@ -3,7 +3,7 @@ class AddSpamToTask < ActiveRecord::Migration | @@ -3,7 +3,7 @@ class AddSpamToTask < ActiveRecord::Migration | ||
3 | change_table :tasks do |t| | 3 | change_table :tasks do |t| |
4 | t.boolean :spam, :default => false | 4 | t.boolean :spam, :default => false |
5 | end | 5 | end |
6 | - Task.update_all ["spam = ?", false] | 6 | + Task.update_all spam: false |
7 | add_index :tasks, [:spam] | 7 | add_index :tasks, [:spam] |
8 | end | 8 | end |
9 | 9 |
db/migrate/20140221142304_move_title_virtual_field_to_name_in_uploaded_file.rb
@@ -3,7 +3,6 @@ class MoveTitleVirtualFieldToNameInUploadedFile < ActiveRecord::Migration | @@ -3,7 +3,6 @@ class MoveTitleVirtualFieldToNameInUploadedFile < ActiveRecord::Migration | ||
3 | UploadedFile.find_each do |uploaded_file| | 3 | UploadedFile.find_each do |uploaded_file| |
4 | uploaded_file.name = uploaded_file.setting.delete(:title) | 4 | uploaded_file.name = uploaded_file.setting.delete(:title) |
5 | UploadedFile.where(id: uploaded_file.id).update_all setting: uploaded_file.setting.to_yaml, name: uploaded_file.name | 5 | UploadedFile.where(id: uploaded_file.id).update_all setting: uploaded_file.setting.to_yaml, name: uploaded_file.name |
6 | - | ||
7 | end | 6 | end |
8 | end | 7 | end |
9 | 8 |