New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: switch to ActiveModel #96
Conversation
@andyjeffries could you please take a look on this? |
Hi @raszi , sorry for the late reply. I did see this but have been struggling with what to do with it. I don't want to release a breaking change within a minor version bump, but in itself it's not enough for a v2 bump. Maybe if it was a non-default option (e.g. you had to set |
Well, if it is a breaking change then it requires a major version bump. It does not need to be big even a super small change could be breaking. Do you agree with my cons and pros? Because if you do then I don't think you should keep the old validations since those are somehow just the duplication of the already existing ActiveModel validations with a slightly different syntax and less extensibility. If you really want to keep your validations or you don't want to introduce a breaking change then I have a different proposal. Let's create an intermediate class which will include everything as the current With this modification if somebody does not want to use the provided validations they could depend on this intermediate class and not on the |
I really like that idea, with an update to the docs pointing people in the right direction, it's the best of all worlds. |
So you want to go with my second proposal and keep your old validations? Or the original to remove them? 😆 |
I liked this idea:
Sorry, it wasn't clear ;-) I can't think of a good name for it though ;-) |
Okay, let me figure it out. I'll open a separate PR for that change. |
Nice one, I'll close this PR then. |
This is a breaking change since the previous version required the validations
to be defined separately. And there are changes in the method definitions too.
ActiveModel uses a different approach, it requires validations to be defined per attribute.
With the previous version:
In the new version:
Why is it good?
ActiveModel::EachValidator
)validates_associated
. #95Why is it bad?