aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/type/helpers
Commit message (Collapse)AuthorAgeFilesLines
* Format the time string according to the precision of the time columnRyuta Kamizono2015-02-201-0/+18
| | | | It is also necessary to format a time column like a datetime column.
* Rm `Type#type_cast`Sean Griffin2015-02-171-1/+1
| | | | | | | | | This helper no longer makes sense as a separate method. Instead I'll just have `deserialize` call `cast` by default. This led to a random infinite loop in the `JSON` pg type, when it called `super` from `deserialize`. Not really a great way to fix that other than not calling super, or continuing to have the separate method, which makes the public API differ from what we say it is.
* `type_cast_from_user` -> `cast`Sean Griffin2015-02-172-2/+2
|
* `type_cast_for_database` -> `serialize`Sean Griffin2015-02-171-2/+2
|
* `Type#type_cast_from_database` -> `Type#deserialize`Sean Griffin2015-02-171-1/+1
|
* rm `Type#number?`Sean Griffin2015-02-071-4/+0
| | | | | This predicate is only used in `query_attribute`, and is relatively easy to remove without adding a bunch of is a checks.
* Move non-type objects into the `Type::Helpers` namespaceSean Griffin2015-02-074-1/+97
| | | | | | | The type code is actually quite accessible, and I'm planning to encourage people to look at the files in the `type` folder to learn more about how it works. This will help reduce the noise from code that is less about type casting, and more about random AR nonsense.
* Push multi-parameter assignement into the typesSean Griffin2015-02-071-0/+30
This allows us to remove `Type::Value#klass`, as it was only used for multi-parameter assignment to reach into the types internals. The relevant type objects now accept a hash in addition to their previous accepted arguments to `type_cast_from_user`. This required minor modifications to the tests, since previously they were relying on the fact that mulit-parameter assignement was reaching into the internals of time zone aware attributes. In reaility, changing those properties at runtime wouldn't change the accessor methods for all other forms of assignment.