aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute_decorators.rb
Commit message (Collapse)AuthorAgeFilesLines
* Stop using instance exec for type decoratorsSean Griffin & Sean Doyle2014-06-271-7/+7
| | | | | | | | We are moving this behavior out to an object that we would like to keep separated from `ActiveRecord::Base`, which means not passing the class object to it. As such, we need to stop using `instance_exec`, and instead close over the subclass on global type decorators that are applied in `Base`.
* add missing `:nodoc:` for recent refactorings. [ci skip]Yves Senn2014-06-241-2/+2
| | | | | | | | | | Adding `# :nodoc:` to the parent `class` / `module` is not going to ignore nested classes or modules. There is a modifier `# :nodoc: all` but sadly the containing class or module will continue to be in the docs. /cc @sgrif
* Promote time zone aware attributes to a first class type decoratorSean Griffin2014-06-161-10/+26
| | | | | | | | | | | | | This refactoring revealed the need for another form of decoration, which takes a proc to select which it applies to (There's a *lot* of cases where this form can be used). To avoid duplication, we can re-implement the old decoration in terms of the proc-based decoration. The reason we're `instance_exec`ing the matcher is for cases such as time zone aware attributes, where a decorator is defined in a parent class, and a method called in the matcher is overridden by a child class. The matcher will close over the parent, and evaluate in its context, which is not the behavior we want.
* Refactor application of type decorators into an objectSean Griffin2014-06-161-8/+24
|
* Don't query the database schema when calling `serialize`Sean Griffin2014-06-071-0/+34
We need to decorate the types lazily. This is extracted to a separate API, as there are other refactorings that will be able to make use of it, and to allow unit testing the finer points more granularly.