pepe wrote in post #955921:
> I want to automate a validation on all (or almost all) my models. That
> validations should happen before every delete/destroy.
>
> The goal is to stop the user from deleting a record if it has any
> 'has*' associations.

Use foreign key constraints in the database for this.  The Foreigner gem 
will help manage these constraints.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to