On Apr 26, 2015, at 5:08 PM, Yannis Kolovos <yannis.kolo...@gmail.com> wrote:

> 
> I would like to protect my model in production of of being deleted
> 
> 
> It would be nice if rails provide this functionality by default ?
> I don't know if there is a functionality like this already but for me its 
> something fundamental
> If there is i couldn't find nothing till now
> Of Course there is the soft delete but this is a different concept 
> I dont know if my concept its valid or not or whats the gotchas but why 
> protected_attributes and not protected_model?

If this is a thing you need to do for legal / regulatory requirements, 
overriding a couple methods is NOT going to be sufficient - someone could 
always use:

  ActiveRecord::Base.connection.execute(‘DELETE FROM protected_stuffs WHERE id 
= 42’)

to bypass all of those. If you really can’t allow a record to be deleted from 
that table, I’d suggest revoking that permission from the user your application 
connects to the database as.

—Matt Jones

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to