You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was wondering if there is an ability to mark attribute as required. So if attribute is not passed in this case, it should raise some error. I found required option for attribute, but not sure how to use it.
So, is it possible to require mandatory attribute?
Thanks for help!
The text was updated successfully, but these errors were encountered:
I will specify question a bit. It's actually working with build in types, just haven't tried that (with String for example). But is doesn't work with my models (for example User).
With build in type: attribute :city, String => Virtus::CoercionError: Failed to coerce attribute city from nil into String
With my mode: attribute :user, User => no failure error
Hi guys
I was wondering if there is an ability to mark attribute as required. So if attribute is not passed in this case, it should raise some error. I found
required
option for attribute, but not sure how to use it.So, is it possible to require mandatory attribute?
Thanks for help!
The text was updated successfully, but these errors were encountered: