search for: log_illegal_operations

Displaying 1 result from an estimated 1 matches for "log_illegal_operations".

2009 Mar 05
6
About before_* callbacks
Hi I have an problem about before_* callbacks. I have a model named: Event And I don''t want anyone to destroy or update any records in Event model. So: [code] class ActiveRecord::Base before_destroy :log_illegal_operations before_update :log_illegal_operations private def log_illegal_operations Event.create({:key => "illegal operation", :value => "Someone wants to update/destroy record(s) in Event model. Blocked!"}) raise ActiveRecord::ReadOnlyRecord, "This is a readonly...