diff options
author | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2017-07-13 07:36:40 +0900 |
---|---|---|
committer | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2017-07-13 07:36:40 +0900 |
commit | 90bb874ea15a16d3fa363a6f5b2fe7302c913f7b (patch) | |
tree | bbe616abfdfbb7f79ed796f4b49ab405a00dd9e5 | |
parent | 58f10a31b37e9bb6e975a71aa63744f318ee043d (diff) | |
download | rails-90bb874ea15a16d3fa363a6f5b2fe7302c913f7b.tar.gz rails-90bb874ea15a16d3fa363a6f5b2fe7302c913f7b.tar.bz2 rails-90bb874ea15a16d3fa363a6f5b2fe7302c913f7b.zip |
Fix boolean column migration script
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/railtie.rb | 2 | ||||
-rw-r--r-- | guides/source/configuring.md | 2 |
3 files changed, 3 insertions, 3 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: diff --git a/guides/source/configuring.md b/guides/source/configuring.md index d7fa8813b2..bc8df5a797 100644 --- a/guides/source/configuring.md +++ b/guides/source/configuring.md @@ -387,7 +387,7 @@ by setting up a rake task which runs ```ruby 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 |