The name `ActiveModel::AttributeAssignment::UnknownAttributeError` is too implementation specific so let's move the constant directly under the ActiveModel namespace. Also since this constant used to be under the ActiveRecord namespace, to make the upgrade path easier, let's avoid raising the former constant when we deal with this error on the Active Record side.
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.
…utesAssignment` Allows to use it for any object as an includable module.
As we move towards removing the `klass` method from `column`, the else clause as it stands right now will become the only case.
The `:timestamp` type for columns is unused. All database adapters treat them as the same database type. All code in `ActiveRecord` which changes its behavior based on the column's type acts the same in both cases. However, when the type is passed to code that checks for the `:datetime` type, but not `:timestamp` (such as XML serialization), the result is unexpected behavior. Existing schema definitions will continue to work, and the `timestamp` type is transparently aliased to `datetime`.
If you are passed an empty hash, then assign_attributes doesn't need to do any work and can just return early. This should fix the failing Agile Web Development tests.
The Time.time_with_datetime_fallback, Time.utc_time and Time.local_time methods were added to handle the limitations of Ruby's native Time implementation. Those limitations no longer apply so we are deprecating them in 4.0 and they will be removed in 4.1.
… plugin or new protection model