aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/type/type_map.rb
Commit message (Collapse)AuthorAgeFilesLines
* Enable `Layout/EmptyLinesAroundAccessModifier` copRyuta Kamizono2019-06-131-1/+0
| | | | | | | | | | | We sometimes say "✂️ newline after `private`" in a code review (e.g. https://github.com/rails/rails/pull/18546#discussion_r23188776, https://github.com/rails/rails/pull/34832#discussion_r244847195). Now `Layout/EmptyLinesAroundAccessModifier` cop have new enforced style `EnforcedStyle: only_before` (https://github.com/rubocop-hq/rubocop/pull/7059). That cop and enforced style will reduce the our code review cost.
* 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
|
* Add `Type.default_value` and use it everywhere for internalRyuta Kamizono2016-08-261-5/+1
| | | | For reduce instantiating `Type::Value`.
* normalizes indentation and whitespace across the projectXavier Noria2016-08-061-12/+12
|
* applies new string literal convention in activerecord/libXavier Noria2016-08-061-1/+1
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Require only necessary concurrent-ruby classes.Jerry D'Antonio2015-11-041-1/+1
|
* Various stylistic nitpicksSean Griffin2015-09-211-1/+1
| | | | | | | We do not need to require each file from AM individually, the type module does that for us. Even if the classes are extremely small right now, I'd rather keep any custom classes needed by AR in their own files, as they can easily have more complex changes in the future.
* `TypeMap` and `HashLookupTypeMap` shouldn't be in Active ModelSean Griffin2015-09-211-0/+64
| | | | | | These are used by the connection adapters to convert SQL type information into the appropriate type object, and makes no sense outside of the context of Active Record
* Move ActiveRecord::Type to ActiveModelKir Shatrov2015-09-211-64/+0
| | | | The first step of bringing typecasting to ActiveModel
* Replaced `ThreadSafe::Map` with successor `Concurrent::Map`.Jerry D'Antonio2015-09-191-3/+3
| | | | | | | The thread_safe gem is being deprecated and all its code has been merged into the concurrent-ruby gem. The new class, Concurrent::Map, is exactly the same as its predecessor except for fixes to two bugs discovered during the merge.
* Ensure the type map's cache is thread safeSean Griffin2014-11-241-3/+7
| | | | | Thanks to @thedarkone for pointing out that an instance of this object is used in a shared context.
* Reintroduce cache with testsSean Griffin2014-11-191-10/+18
|
* Add tests for `TypeMap#fetch` and push up to `TypeMap`Sean Griffin2014-11-191-1/+5
| | | | | | | It doesn't make sense for the subclass to implement this method, and not have it on the parent. We can also DRY up the implementation of `#lookup` to be defined in terms of fetch, which will give us a single point of entry
* Move types to the top level `ActiveRecord` namespaceSean Griffin2014-05-271-0/+48
`ActiveRecord::ConnectionAdapters::Type::Value` => `ActiveRecord::Type::Value`