judge icon indicating copy to clipboard operation
judge copied to clipboard

Judge includes not added model's validations

Open matedemorphy opened this issue 5 years ago • 1 comments

Hi, I've been solving different bugs for days, and now i realize that the gem it's adding validations tha i have not declared in the model. For example

validates :email, presence: true, format: { with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i }, on: :create

but adds uniqueness validation to the input, in fact even if a remove all the validations from the model, unless i remove :validate => true from the input field it will set all that validations the same.

matedemorphy avatar Nov 28 '19 02:11 matedemorphy

this line: expose Admin, :email in judge.rb initializer solve in some way the error, but i don't want validate uniqueness from client side, even worst i'm getting this error now:

method_missing': undefined method has_one_attached' for Admin (call 'Admin.connection' to establish a connection)`

i'm using Active Storage in that same model: has_one_attached :avatar

matedemorphy avatar Nov 28 '19 03:11 matedemorphy