aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/type/integer.rb
Commit message (Collapse)AuthorAgeFilesLines
* Recover perf for `pluck` by reverting 9c9c950d02af83742a5f76302d0faa99508f242c.Guo Xiang Tan2019-05-031-0/+5
| | | | This reverts commit 9c9c950d02af83742a5f76302d0faa99508f242c.
* Merge pull request #35336 from ↵Ryuta Kamizono2019-02-211-6/+4
|\ | | | | | | | | kamipo/dont_allow_non_numeric_string_matches_to_zero Don't allow `where` with non numeric string matches to 0 values
| * Don't allow `where` with non numeric string matches to 0 valuesRyuta Kamizono2019-02-201-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | This is a follow-up of #35310. Currently `Topic.find_by(id: "not-a-number")` matches to a `id = 0` record. That is considered as silently leaking information. If non numeric string is given to find by an integer column, it should not be matched to any record. Related #12793.
* | Revert "Speed up integer casting from DB"Ryuta Kamizono2019-02-211-5/+0
|/ | | | | | | | | | | This reverts commit 52fddcc653458456f98b3683dffd781cf00b35fe. 52fddcc was to short-circuit `ensure_in_range` in `cast_value`. But that caused a regression for empty string deserialization. Since 7c6f393, `ensure_in_range` is moved into `serialize`. As 52fddcc said, the absolute gain is quite small. So I've reverted that commit to fix the regression.
* Extract duplicated `serialize` methods into helpersRyuta Kamizono2019-02-181-7/+2
| | | | | | | | Since `serialize` is passed user input args (from `where`, schema default, etc), a helper should provide `serialize` if the helper also provide `cast`. Related #32624, 34cc301, a741208.
* Rails 6 requires Ruby 2.3+Jeremy Daer2018-02-171-6/+1
|
* [ci skip] Postgres --> PostgreSQLRyuta Kamizono2017-08-081-1/+1
|
* 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
|
* Indicate units of 'limit' in 'Integer' error message.Corey Farwell2017-02-151-1/+1
|
* Describe what we are protectingAkira Matsuda2016-12-231-0/+2
|
* code gardening: removes redundant selfsXavier Noria2016-08-081-1/+1
| | | | | | | | | A few have been left for aesthetic reasons, but have made a pass and removed most of them. Note that if the method `foo` returns an array, `foo << 1` is a regular push, nothing to do with assignments, so no self required.
* normalizes indentation and whitespace across the projectXavier Noria2016-08-061-21/+21
|
* Change RangeError to a more specific ActiveModel::RangeErrorChristian Blais2016-05-031-1/+1
| | | | | | 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 ActiveRecord::Type to ActiveModelKir Shatrov2015-09-211-0/+66
The first step of bringing typecasting to ActiveModel