aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/multiparameter_attributes_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Autocorrect `refute` RuboCop violationsDaniel Colson2018-04-031-1/+1
| | | | | | 73e7aab behaved as expected on codeship, failing the build with exactly these RuboCop violations. Hopefully `rubocop -a` will have been enough to get a passing build!
* Use assert_predicate and assert_not_predicateDaniel Colson2018-01-251-1/+1
|
* Use respond_to test helpersDaniel Colson2018-01-251-2/+2
|
* Use frozen-string-literal in ActiveRecordKir Shatrov2017-07-191-0/+2
|
* Allow multiparameter assigned attributes to be used with `text_field`Sean Griffin2017-07-171-0/+11
| | | | | | | | | | | | | | | | | | | | | Between 4.2 and 5.0 the behavior of how multiparameter attributes interact with `_before_type_cast` changed. In 4.2 it returns the post-type-cast value. After 5.0, it returns the hash that gets sent to the type. This behavior is correct, but will cause an issue if you then tried to render that value in an input like `text_field` or `hidden_field`. In this case, we want those fields to use the post-type-cast form, instead of the `_before_type_cast` (the main reason it uses `_before_type_cast` at all is to avoid losing data when casting a non-numeric string to integer). I've opted to modify `came_from_user?` rather than introduce a new method for this as I want to avoid complicating that contract further, and technically the multiparameter hash didn't come from assignment, it was constructed internally by AR. Close #27888.
* Fix `create_with` with multiparameter attributesRyuta Kamizono2017-07-161-13/+32
|
* 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 datatime errorSen-Zhang2016-11-011-0/+7
|
* Add more rubocop rules about whitespacesRafael Mendonça França2016-10-291-4/+4
|
* applies new string literal convention in activerecord/testXavier Noria2016-08-061-2/+2
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Fixes multiparameter attributes conversion with time_zone_aware_attributes ↵alpaca-tc2016-07-191-0/+14
| | | | and invalid params
* Merge pull request #25372 from kamipo/remove_assert_date_from_dbSean Griffin2016-06-131-1/+1
|\ | | | | Remove unnecessary `assert_date_from_db`
| * Remove unnecessary `assert_date_from_db`Ryuta Kamizono2016-06-121-1/+1
| | | | | | | | | | | | `assert_date_from_db` was added at 6a2104d for SQL Server. But latest sqlserver adapter work to pass expected behavior since 8e4624b.
* | Remove outdated comments [ci skip]Ryuta Kamizono2016-06-121-12/+0
|/ | | | | These comments were added at dd257a3ccb30ab181cd48d3d81bc7f23bb45f36f but outdated since #2086.
* Push multi-parameter assignement into the typesSean Griffin2015-02-071-0/+8
| | | | | | | | | | | | This allows us to remove `Type::Value#klass`, as it was only used for multi-parameter assignment to reach into the types internals. The relevant type objects now accept a hash in addition to their previous accepted arguments to `type_cast_from_user`. This required minor modifications to the tests, since previously they were relying on the fact that mulit-parameter assignement was reaching into the internals of time zone aware attributes. In reaility, changing those properties at runtime wouldn't change the accessor methods for all other forms of assignment.
* Time columns should support time zone aware attributesSean Griffin2015-01-151-2/+2
| | | | | | The types that are affected by `time_zone_aware_attributes` (which is on by default) have been made configurable, in case this is a breaking change for existing applications.
* Remove dead test code for unsupported adaptersSean Griffin2014-05-171-2/+2
|
* Don't skip tests if we don't need to.Rafael Mendonça França2013-11-081-6/+6
| | | | | | | We can conditional define the tests depending on the adapter or connection. Lets keep the skip for fail tests that need to be fixed.
* prevent global timezone state from leaking out of test cases.Yves Senn2013-10-251-82/+78
|
* reset default timezone and make test order independentNeeraj Singh2013-07-281-0/+4
|
* Remove unneeded requireRafael Mendonça França2012-10-061-1/+0
|
* Move multiparameter attributes related tests to its own fileRafael Mendonça França2012-10-061-0/+351