On Thursday, August 3, 2017 at 11:05:49 PM UTC-7, Mike Pastore wrote:
>
> On Thursday, August 3, 2017 at 11:45:54 AM UTC-5, Jeremy Evans wrote:
>>
>> It's not difficult to do so yourself, maybe via something like this:
>>
>> def after_validation
>>   super
>>   errors.keys.each do |column|
>>     if assocs = model.autoreloading_associations[column]
>>       assocs.each{|a| errors[a] = errors.delete(column)}
>>     end
>>   end
>> end
>>
>
> Ah, I had to make some tweaks (I think it's 
> model.class.autoreloading_associations), but that works great for my use 
> case. Thanks Jeremy!  
>

model returns the class, so model.class.autoreloading_associations looks 
wrong to me if called from a Model instance method.  But I'm glad it's 
working for you.

Thanks,
Jeremy 

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to