| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
We do not need to require each file from AM individually, the type
module does that for us. Even if the classes are extremely small right
now, I'd rather keep any custom classes needed by AR in their own files,
as they can easily have more complex changes in the future.
|
|
|
|
| |
The first step of bringing typecasting to ActiveModel
|
|
|
|
| |
It is also necessary to format a time column like a datetime column.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The various databases don't actually need significantly different
handling for this behavior, and they can achieve it without knowing
about the type of the object.
The old implementation was returning a string, which will cause problems
such as breaking TZ aware attributes, and making it impossible for the
adapters to supply their logic for time objects.
|
|
|
|
|
| |
If timestamp column have the precision, it need to format according to
the precision of timestamp column.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
The case where we have a column object, but don't have a type cast
method involves type casting the default value when changing the schema.
We get one of the column definition structs instead. That is a case that
I'm trying to remove overall, but in the short term, we can achieve the
same behavior without needing to pass the adapter to the array type by
creating a fake type that proxies to the adapter.
|
|
`ActiveRecord::ConnectionAdapters::Type::Value` =>
`ActiveRecord::Type::Value`
|