aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2017-07-15 20:23:15 +0200
committerGitHub <noreply@github.com>2017-07-15 20:23:15 +0200
commit9930b97e7d9afc8fd7ec10efe649d5e10b4f9556 (patch)
treed94d8ee9f90b63a243b060b415b9b11602ae559d /activerecord/lib/active_record
parent89182d681013e42c514860b24f197ab84a8662f5 (diff)
parent90bb874ea15a16d3fa363a6f5b2fe7302c913f7b (diff)
downloadrails-9930b97e7d9afc8fd7ec10efe649d5e10b4f9556.tar.gz
rails-9930b97e7d9afc8fd7ec10efe649d5e10b4f9556.tar.bz2
rails-9930b97e7d9afc8fd7ec10efe649d5e10b4f9556.zip
Merge pull request #29770 from y-yagi/fix_boolean_column_migration_script
Fix boolean column migration script
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb2
-rw-r--r--activerecord/lib/active_record/railtie.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
index b79dbe0733..5174c98c4b 100644
--- a/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
@@ -82,7 +82,7 @@ module ActiveRecord
# Conversion can be accomplished by setting up a rake task which runs
#
# ExampleModel.where("boolean_column = 't'").update_all(boolean_column: 1)
- # ExampleModel.where("boolean_column = 't'").update_all(boolean_column: 0)
+ # ExampleModel.where("boolean_column = 'f'").update_all(boolean_column: 0)
# for all models and all boolean columns, after which the flag must be set
# to true by adding the following to your application.rb file:
#
diff --git a/activerecord/lib/active_record/railtie.rb b/activerecord/lib/active_record/railtie.rb
index 962ed880b9..9b19e85b33 100644
--- a/activerecord/lib/active_record/railtie.rb
+++ b/activerecord/lib/active_record/railtie.rb
@@ -187,7 +187,7 @@ serialization) before setting this flag to true. Conversion can be accomplished
by setting up a rake task which runs
ExampleModel.where("boolean_column = 't'").update_all(boolean_column: 1)
- ExampleModel.where("boolean_column = 't'").update_all(boolean_column: 0)
+ ExampleModel.where("boolean_column = 'f'").update_all(boolean_column: 0)
for all models and all boolean columns, after which the flag must be set to
true by adding the following to your application.rb file: