Exception: MR::Model::InvalidError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- MR::Model::InvalidError
- Defined in:
- lib/mr/model/persistence.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
-
#initialize(model, errors, backtrace = nil) ⇒ InvalidError
constructor
A new instance of InvalidError.
Constructor Details
#initialize(model, errors, backtrace = nil) ⇒ InvalidError
Returns a new instance of InvalidError.
68 69 70 71 72 73 74 75 |
# File 'lib/mr/model/persistence.rb', line 68 def initialize(model, errors, backtrace = nil) @errors = errors || {} desc = @errors.map do |(attribute, )| .map{ || "#{attribute.inspect} #{message}" } end.sort.join(', ') super "Invalid #{model.class} couldn't be saved: #{desc}" set_backtrace(backtrace) if backtrace end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
66 67 68 |
# File 'lib/mr/model/persistence.rb', line 66 def errors @errors end |