I also have a use case for this, and have implemented it in a similar way 
to Yannis. We use it as a safety net - all devs know that they shouldn't 
delete protected models, but there are some models (such as financial 
transactions) that we want to add a safety net to.

On Monday, 27 April 2015 09:45:24 UTC+1, Mohammad AbuShady wrote:
>
>  I'm not sure if this does the same but you could add `readonly` in the 
> `default_scope`, this way all initialized objects will always be read only 
> and protected from destruction.
>
 
Adding readonly would also prevent updates though?

-- 
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.

Reply via email to