aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/migration/columns_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Use assert_predicate and assert_not_predicateDaniel Colson2018-01-251-7/+7
|
* Skip `test_remove_column_with_multi_column_index`Yasuo Honda2017-09-011-0/+4
| | | | | | | | | | when tested with MariaDB 10.2.8 or higher Refer #30485 https://mariadb.com/kb/en/the-mariadb-library/alter-table/#drop-column-if-exists-col_name-cascaderestrict > MariaDB starting with 10.2.8 > Dropping a column that is part of a multi-column UNIQUE constraint is not permitted.
* Use frozen-string-literal in ActiveRecordKir Shatrov2017-07-191-0/+2
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* Fix `change_column` to drop default with `null: false`Ryuta Kamizono2017-02-261-0/+10
| | | | | | | | | | | | | | | | Currently `change_column` cannot drop default if `null: false` is specified at the same time. This change fixes the issue. ```ruby # cannot drop default change_column "tests", "contributor", :boolean, default: nil, null: false # we need the following workaround currently change_column "tests", "contributor", :boolean, null: false change_column "tests", "contributor", :boolean, default: nil ``` Closes #26582
* improve error message when include assertions failMichael Grosser2016-09-161-4/+4
| | | | | | assert [1, 3].includes?(2) fails with unhelpful "Asserting failed" message assert_includes [1, 3], 2 fails with "Expected [1, 3] to include 2" which makes it easier to debug and more obvious what went wrong
* fixes remaining RuboCop issues [Vipul A M, Xavier Noria]Xavier Noria2016-09-011-4/+4
|
* revises most Lint/EndAlignment offensesXavier Noria2016-08-071-3/+4
| | | | Some case expressions remain, need to think about those ones.
* normalizes indentation and whitespace across the projectXavier Noria2016-08-061-1/+1
|
* modernizes hash syntax in activerecordXavier Noria2016-08-061-19/+19
|
* applies new string literal convention in activerecord/testXavier Noria2016-08-061-43/+43
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Remove legacy mysql adapterAbdelkader Boudih2015-12-171-1/+1
|
* Add reversible syntax for change_column_defaultPrem Sichanugrist2015-06-261-0/+7
| | | | | | | | | | | | | Passing `:from` and `:to` to `change_column_default` makes this command reversible as user has defined its previous state. So, instead of having the migration command as: change_column_default(:posts, :state, "draft") They can write it as: change_column_default(:posts, :state, from: nil, to: "draft")
* Closes rails/rails#18864: Renaming transactional fixtures to transactional testsBrandon Weiss2015-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | I’m renaming all instances of `use_transcational_fixtures` to `use_transactional_tests` and “transactional fixtures” to “transactional tests”. I’m deprecating `use_transactional_fixtures=`. So anyone who is explicitly setting this will get a warning telling them to use `use_transactional_tests=` instead. I’m maintaining backwards compatibility—both forms will work. `use_transactional_tests` will check to see if `use_transactional_fixtures` is set and use that, otherwise it will use itself. But because `use_transactional_tests` is a class attribute (created with `class_attribute`) this requires a little bit of hoop jumping. The writer method that `class_attribute` generates defines a new reader method that return the value being set. Which means we can’t set the default of `true` using `use_transactional_tests=` as was done previously because that won’t take into account anyone using `use_transactional_fixtures`. Instead I defined the reader method manually and it checks `use_transactional_fixtures`. If it was set then it should be used, otherwise it should return the default, which is `true`. If someone uses `use_transactional_tests=` then it will overwrite the backwards-compatible method with whatever they set.
* `Type#type_cast_from_database` -> `Type#deserialize`Sean Griffin2015-02-171-3/+3
|
* Add `auto_increment?` instead of `extra == 'auto_increment'`Ryuta Kamizono2015-02-081-1/+1
|
* Remove most type related predicates from `Column`Sean Griffin2015-01-301-3/+3
| | | | | | Remaining are `limit`, `precision`, `scale`, and `type` (the symbol version). These will remain on the column, since they mirror the options to the `column` method in the schema definition DSL
* Be sure to reset PK name renamed in the testAkira Matsuda2014-08-151-0/+3
|
* Don't type cast the default on the columnSean Griffin2014-06-171-5/+12
| | | | | | | If we want to have type decorators mess with the attribute, but not the column, we need to stop type casting on the column. Where possible, we changed the tests to test the value of `column_defaults`, which is public API. `Column#default` is not.
* Make `:index` in migrations work with all column typesMarc Schütz2014-05-181-0/+10
|
* anual_salary => annual_salaryVipul A M2013-03-281-3/+3
|
* respect auto_increment in rename_column for mysqlVipul A M2013-03-271-0/+7
|
* Oracle enhanced adapter shortens its name if it is longer than 30 bytesYasuo Honda2013-02-241-2/+10
| | | | because of Oracle database index length spec.
* also rename the test-case class inside columns_test.rbYves Senn2013-02-241-1/+1
|
* rename_column_test.rb -> columns_test.rb to reveal intent.Yves Senn2013-02-231-0/+264
I renamed the test to better communicate it's intention. Since it also tests: - add_column - remove_column - change_column There is no reason to call it rename_column_test.