Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Simplify the implementation of Active Model's type registry | Sean Griffin | 2015-09-21 | 1 | -6/+11 |
| | | | | | | | | | | | | | | | Things like decorations, overrides, and priorities only matter for Active Record, so the Active Model registry can be implemented much more simply. At this point, I wonder if having Active Record's registry inherit from Active Model's is even worth the trouble? The Active Model class was also missing test cases, which have been backfilled. This removes the error when two types are registered with the same name, but given that Active Model is meant to be significantly more generic, I do not think this is an issue for now. If we want, we can raise an error at the point that someone tries to register it. | ||||
* | Move ActiveRecord::Type to ActiveModel | Kir Shatrov | 2015-09-21 | 1 | -28/+11 |
| | | | | The first step of bringing typecasting to ActiveModel | ||||
* | Register adapter specific types with the global type registry | Sean Griffin | 2015-02-15 | 1 | -1/+4 |
| | | | | | | We do this in the adapter classes specifically, so the types aren't registered if we don't use that adapter. Constants under the PostgreSQL namespace for example are never loaded if we're using mysql. | ||||
* | Add a global type registry, used to lookup and register types | Sean Griffin | 2015-02-15 | 1 | -0/+139 |
As per previous discussions, we want to give users the ability to reference their own types with symbols, instead of having to pass the object manually. This adds the class that will be used to do so. ActiveRecord::Type.register(:money, MyMoneyType) |