aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute_methods/before_type_cast.rb
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #15846 from sgrif/sg-attributes-before-type-castRafael Mendonça França2014-06-261-1/+1
|\ | | | | | | | | | | | | | | Move `attributes_before_type_cast` to `AttributeSet` Conflicts: activerecord/lib/active_record/attribute_set.rb activerecord/test/cases/attribute_set_test.rb
| * Move `attributes_before_type_cast` to `AttributeSet`Sean Griffin2014-06-211-1/+1
| |
* | Return a null object from `AttributeSet#[]`Sean Griffin2014-06-201-3/+1
|/
* Introduce an Attribute object to handle the type casting danceSean Griffin2014-06-131-2/+4
| | | | | | | | | | | | | | | There's a lot more that can be moved to these, but this felt like a good place to introduce the object. Plans are: - Remove all knowledge of type casting from the columns, beyond a reference to the cast_type - Move type_cast_for_database to these objects - Potentially make them mutable, introduce a state machine, and have dirty checking handled here as well - Move `attribute`, `decorate_attribute`, and anything else that modifies types to mess with this object, not the columns hash - Introduce a collection object to manage these, reduce allocations, and not require serializing the types
* Rename attribute related instance variables to better express intentSean Griffin2014-05-301-2/+2
| | | | | | | | | `@attributes` was actually used for `_before_type_cast` and friends, while `@attributes_cache` is the type cast version (and caching is the wrong word there, but I'm working on removing the conditionals around that). I opted for `@raw_attributes`, because `_before_type_cast` is also semantically misleading. The values in said hash are in the state given by the form builder or database, so raw seemed to be a good word.
* read_attribute_before_type_cast should accept symbolNeeraj Singh2013-05-111-1/+2
|
* Fix code example in AR::AttributeMethods::BeforeTypeCast.Hendy Tanata2012-10-221-1/+1
|
* add docs to AR::AttributeMethods::BeforeTypeCast [ci skip]Francesco Rodriguez2012-10-211-0/+23
|
* fix typo and improve example [ci skip]Francesco Rodriguez2012-10-211-1/+3
|
* update AR::AttributeMethods::BeforeTypeCast docs [ci skip]Francesco Rodriguez2012-10-211-0/+18
|
* move id_before_type_cast to PrimaryKey moduleSergey Nartimov2012-02-161-5/+1
|
* Fix indentation hereSantiago Pastorino2010-12-041-7/+8
|
* attributes_before_type_cast are just the value of @attributesSantiago Pastorino2010-12-041-1/+1
|
* No need to use inject here, use map instead.Emilio Tagua2010-09-221-4/+1
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Revert "Refactoring attributes/types" [#3348 state:open]Pratik Naik2010-01-221-3/+10
| | | | | | | | | | | | | | | | | This reverts commit f936a1f100e75082081e782e5cceb272885c2df7. Conflicts: activerecord/lib/active_record.rb activerecord/lib/active_record/base.rb Revert "Fixed: #without_typecast should only disable typecasting on the duplicated attributes" [#3387 state:open] This reverts commit 2831996483c6a045f1f38d8030256eb58d9771c3. Reason : It's not generating attribute methods properly, making object.column 5x slower.
* Refactoring attributes/types [#3348 state:resolved]Eric Chapweske2009-10-171-10/+3
| | | | Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Don't define id_before_type_cast, just let it be generated on its ownJoshua Peek2009-07-301-5/+5
|
* Move id attribute methods into their related concernJoshua Peek2009-07-301-0/+12
|
* Concernify AR AttributeMethodsJoshua Peek2009-07-301-0/+21