aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/cases/type/integer_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Use frozen string literal in activemodel/Kir Shatrov2017-07-161-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 invalid string Decimal casting under ruby 2.4John Hawthorn2017-02-241-0/+1
| | | | | | | | | | | | | | | | | | | In Ruby 2.4, BigDecimal(), as used by the Decimal cast, was changed so that it will raise ArgumentError when passed an invalid string, in order to be more consistent with Integer(), Float(), etc. The other numeric types use ex. to_i and to_f. Unfortunately, we can't simply change BigDecimal() to to_d. String#to_d raises errors like BigDecimal(), unlike all the other to_* methods (this should probably be filed as a ruby bug). Instead, this simulates the existing behaviour and the behaviour of the other to_* methods by finding a numeric string at the start of the passed in value, and parsing that using BigDecimal(). See also https://bugs.ruby-lang.org/issues/10286 https://github.com/ruby/bigdecimal/commit/3081a627cebdc1fc119425c7a9f009dbb6bec8e8
* Add more rubocop rules about whitespacesRafael Mendonça França2016-10-291-2/+2
|
* Refactored ActiveModel::Type tests into their own filesIain Beeston2016-10-151-0/+7
|
* remove redundant curlies from hash argumentsXavier Noria2016-08-061-1/+1
|
* applies new string literal convention in activemodel/testXavier Noria2016-08-061-9/+9
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Change RangeError to a more specific ActiveModel::RangeErrorChristian Blais2016-05-031-6/+6
| | | | | | The should make it easier for apps to rescue ActiveModel specific errors without the need to wrap all method calls with a generic rescue RangeError.
* Move the appropriate type tests to the Active Model suiteSean Griffin2015-09-211-0/+108
Any tests for a type which is not overridden by Active Record, and does not test the specifics of the attributes API interacting in more complex ways have no reason to be in the Active Record suite. Doing this revealed that the implementation of the date and time types in AM was actually completely broken, and incapable of returning any value other than `nil`.