Module: Abbish::Sequel::Plugins::Model::SuperRecord::Protection
- Defined in:
- lib/model/super_record/protection.rb
Defined Under Namespace
Modules: ClassMethods, InstanceMethods
Constant Summary collapse
- ProtectedError =
Class.new(::StandardError)
Class Method Summary collapse
Class Method Details
.configure(model, options = {}) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/model/super_record/protection.rb', line 8 def self.configure(model, = {}) = { :enabled => true, :feature_column_protected => :record_protected, :raise_protected_message => 'Cannot destroy protected record', }.merge() Abbish::Sequel::Plugins::Model::SuperRecord.check_feature_column model, [:feature_column_protected] model.instance_eval do self. = end end |