Instead of using its own rules, rails_param could use a ActiveModel class to validate the params.
This would be a major rewrite of the library.
The benefit is that the developer will be able to use all the known validations he already uses, like:
param! :phone_number, String, presence: true, length: { minimum: 3 }
Typecasting and transformation will still be implemented internally (I could use some other gems like Virtus but for the moment I don't want dependencies).
It will also be possible for the developper to access the errors Hash.
Instead of using its own rules, rails_param could use a ActiveModel class to validate the params.
This would be a major rewrite of the library.
The benefit is that the developer will be able to use all the known validations he already uses, like:
Typecasting and transformation will still be implemented internally (I could use some other gems like Virtus but for the moment I don't want dependencies).
It will also be possible for the developper to access the errors Hash.