Exception: Ace::Support::Models::ModelNotFoundError
- Inherits:
-
ValidationError
- Object
- StandardError
- Error
- ValidationError
- Ace::Support::Models::ModelNotFoundError
- Defined in:
- lib/ace/support/models/errors.rb
Overview
Model not found error
Instance Attribute Summary collapse
-
#model_id ⇒ Object
readonly
Returns the value of attribute model_id.
-
#suggestions ⇒ Object
readonly
Returns the value of attribute suggestions.
Instance Method Summary collapse
-
#initialize(model_id, suggestions: []) ⇒ ModelNotFoundError
constructor
A new instance of ModelNotFoundError.
Constructor Details
#initialize(model_id, suggestions: []) ⇒ ModelNotFoundError
Returns a new instance of ModelNotFoundError.
32 33 34 35 36 37 38 |
# File 'lib/ace/support/models/errors.rb', line 32 def initialize(model_id, suggestions: []) @model_id = model_id @suggestions = suggestions = "Model '#{model_id}' not found" += ". Did you mean: #{suggestions.join(", ")}?" if suggestions.any? super() end |
Instance Attribute Details
#model_id ⇒ Object (readonly)
Returns the value of attribute model_id.
30 31 32 |
# File 'lib/ace/support/models/errors.rb', line 30 def model_id @model_id end |
#suggestions ⇒ Object (readonly)
Returns the value of attribute suggestions.
30 31 32 |
# File 'lib/ace/support/models/errors.rb', line 30 def suggestions @suggestions end |