Exception: InvalidSchemaError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/relation_to_json.rb

Instance Method Summary collapse

Constructor Details

#initialize(invalid_attributes, klass) ⇒ InvalidSchemaError

Returns a new instance of InvalidSchemaError.



8
9
10
11
# File 'lib/relation_to_json.rb', line 8

def initialize(invalid_attributes, klass)
  @invalid_attributes = invalid_attributes
  @klass = klass
end

Instance Method Details

#messageObject



13
14
15
# File 'lib/relation_to_json.rb', line 13

def message
  "The attributes: #{@invalid_attributes} do not exist on the model: #{@klass.name}, which has attributes #{@klass.column_names}"
end