The ActiveModel type system with extensions in ActiveRecord provide
us a lot of convenience. Some general attribute code is now moved to
ActiveModel only as the AR types provide raw value capturing
(before_type_cast) and type classes to handle type specific string
value parsing if enabled.
In my view, we need to go futher and strip out more from ActiveModel
extension but at least we should have compatibility at the moment.
Multiparamter extension used to do a lot of crappy work to ensure that
the invalid Date dates were not accepted, but also to store a
before_type_cast value in cases when it was invalid. We no longer need
to handle the before_type_cast value as ActiveRecord does that nicely.
Now we just ensure values to cast with a invalid date parts is not
accepted.
move validation helpers into ActiveModel::Validations for default base support
add check if attribute methods shim is being used
refactor specs for helper and attribute methods separation
more mongoid workarounds due to incorrect use of AS::Concern
cache raw value in @attributes_cache which is AR convention but should
work fine with non-AR ORM
before type cast method for reading back cached raw value
completely rewritten for ActiveModel compatibility
uses ActiveModel EachValidator class as validator base class
simplifies :between by splitting into a :on_or_before and an :on_of_after
only :is_at option tested