aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute_methods/before_type_cast.rb
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Fix broken comments indentation caused by rubocop auto-correct [ci skip]Ryuta Kamizono2016-09-141-1/+1
| | | | | | All indentation was normalized by rubocop auto-correct at 80e66cc4d90bf8c15d1a5f6e3152e90147f00772. But comments was still kept absolute position. This commit aligns comments with method definitions for consistency.
* normalizes indentation and whitespace across the projectXavier Noria2016-08-061-6/+6
|
* applies new doc guidelines to Active Record.Yves Senn2015-10-141-1/+1
| | | | | | | | | | | | | | | | | | | The focus of this change is to make the API more accessible. References to method and classes should be linked to make it easy to navigate around. This patch makes exzessiv use of `rdoc-ref:` to provide more readable docs. This makes it possible to document `ActiveRecord::Base#save` even though the method is within a separate module `ActiveRecord::Persistence`. The goal here is to bring the API closer to the actual code that you would write. This commit only deals with Active Record. The other gems will be updated accordingly but in different commits. The pass through Active Record is not completely finished yet. A follow up commit will change the spots I haven't yet had the time to update. /cc @fxn
* Only use the `_before_type_cast` in the form when from user inputSean Griffin2015-01-141-0/+5
| | | | | | While we don't want to change the form input when validations fail, blindly using `_before_type_cast` will cause the input to display the wrong data for any type which does additional work on database values.
* 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