Closed h0tl33t closed 9 years ago
Looks fine, though I'm kinda bummed about losing the keyword args. Is there a need to pass options other than on
? If not, I'd rather add a keyword arg for it (docs indicate nil
is the default value for on
, so this should be fine).
def has_photo(name, required: false, on: nil)
Not at this point. My use case was just for :on
, so if we can pass nil
for default, I'll update this to use keyword args like you suggested.
The goal of this PR is to allow users to pass through additional validation options aside from
required: true
. I ran into a case where I need to seed records that are not user-creatable, but users should be able to update with photos and other things that are required on update.Basically, I'd like us to be able to do the following: