Exception: Sequel::MassAssignmentRestriction
- Defined in:
- lib/sequel/model/exceptions.rb
Overview
Raised when a mass assignment method is called in strict mode with either a restricted column or a column without a setter method.
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
The column related to this exception, as a string.
-
#model ⇒ Object
readonly
The Sequel::Model object related to this exception.
Attributes inherited from Error
Class Method Summary collapse
-
.create(msg, model, column) ⇒ Object
Create an instance of this class with the model and column set.
Methods inherited from Error
Instance Attribute Details
#column ⇒ Object (readonly)
The column related to this exception, as a string.
34 35 36 |
# File 'lib/sequel/model/exceptions.rb', line 34 def column @column end |
#model ⇒ Object (readonly)
The Sequel::Model object related to this exception.
31 32 33 |
# File 'lib/sequel/model/exceptions.rb', line 31 def model @model end |
Class Method Details
.create(msg, model, column) ⇒ Object
Create an instance of this class with the model and column set.
37 38 39 40 41 42 |
# File 'lib/sequel/model/exceptions.rb', line 37 def self.create(msg, model, column) e = new("#{msg} for class #{model.class.inspect}") e.instance_variable_set(:@model, model) e.instance_variable_set(:@column, column) e end |