Rails, destroy if blank
- by Joseph Silvashy
This might sound odd, but is there a 'Rails way' to have a model destroyed if a certain attribute is blank? Say I have a model like tags with just a name attribute or something, if the user edits the tag and deletes all the text out of the name field in the form I'd like the model to just be deleted.
I'm aware of the reject_if method, but that doesn't seem to work.