Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Fix invalid string Decimal casting under ruby 2.4 | John Hawthorn | 2017-02-24 | 1 | -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 whitespaces | Rafael Mendonça França | 2016-10-29 | 1 | -2/+2 |
| | |||||
* | Refactored ActiveModel::Type tests into their own files | Iain Beeston | 2016-10-15 | 1 | -0/+7 |
| | |||||
* | remove redundant curlies from hash arguments | Xavier Noria | 2016-08-06 | 1 | -1/+1 |
| | |||||
* | applies new string literal convention in activemodel/test | Xavier Noria | 2016-08-06 | 1 | -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::RangeError | Christian Blais | 2016-05-03 | 1 | -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 suite | Sean Griffin | 2015-09-21 | 1 | -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`. |