Commit Graph

7 Commits

Author SHA1 Message Date
Pedro Paiva
709d2c87e2
Add Rails 6.1 compatibility
Rails 6.1 needs the following changes:
- Add `owner: nil` to `define_method_attribute` calls
- Pass `options` to error `add` method as keyword argument

Ref:
- https://api.rubyonrails.org/v6.0.0/classes/ActiveModel/Errors.html#method-i-add
- https://api.rubyonrails.org/v6.1.0/classes/ActiveModel/Errors.html#method-i-add

Fix: #193
2021-01-10 10:28:52 +01:00
Adam Meehan
e5bb096161 Move method generation to ActiveModel only and use type system in AR
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.
2018-05-19 15:22:23 +10:00
Adam Meehan
8dc191a4cd Update TextModel method_missing with current ActiveModel methods 2018-05-15 19:26:54 +10:00
Adam Meehan
7d006bd3bd not a fix but stops stack recursion problem 2018-05-15 17:22:43 +10:00
Adam Meehan
08b16f155c Rspec 3 syntax 2015-12-29 14:55:03 +11:00
Adam Meehan
473da0fa5e Fix DateTimeSelect extension for Rails 3.1.0 2011-09-18 18:37:01 +10:00
Adam Meehan
983e80f239 move some files into spec/support and include ModelHelpers in config 2011-01-28 19:36:02 +11:00