Closed palkan closed 5 years ago
AR 3.2 is not supported by this gem: https://travis-ci.org/toptal/database_validations/jobs/496140442
Ruby <2.5 is not supported, too: https://travis-ci.org/toptal/database_validations/jobs/496143426 (so this one, probably, should be easy to fix).
Except probably the gem is only compatible with AR 4.2+.
Except probably the gem is only compatible with AR 4.2+.
Yeah, it should be. I'm trying to make specs work)
@pirj What about Ruby 2.4? We can try to make it work, too
the gem is only compatible with AR 4.2+.
It's not( https://travis-ci.org/toptal/database_validations/jobs/496152914
@palkan Definitely, I believe something like klass.__send__(:alias_method
will fix the issue.
As per this writeup, which is only a bit over one year old, about a third of installations use Rubies that don't receive security updates anymore. Keeping in mind that 2.3 will fall into this category by April, it doesn't make much sense to support versions prior to 2.4.
the gem is only compatible with AR 4.2+.
It's not
You're right!
Unknown key: :optional
should be relatively easy to fix as well by picking either options.merge(optional: true)
or options.merge(required: false)
depending on AR version.
undefined method 'details' for #<ActiveModel::Errors
might be more tricky. Let's probably leave it up for @djezzzl to add support for 4.2?
Finally, we're green)
Not supported by Rails 4 features are excluded from specs (using RAILS_5
constant and a few changes).
Differences in belongs_to
are handled in code (optional
vs required
and error messages).
Let's try to make it work on Ruby 2.4
Ok, Ruby 2.4 is fixed, too
Thank you for your contribution!
👏
Thanks for the gem!
I'm using it with Rails 6 – it works) So, let's relax the constraints.
Added travis configuration to run tests against different versions (to make sure that it really works).