Exception: OccamsRecord::Results::MissingColumnSelectError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/occams-record/results.rb

Overview

Exception when an unselected column is called on a result row

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model_name, name) ⇒ MissingColumnSelectError

Returns a new instance of MissingColumnSelectError.



147
148
149
# File 'lib/occams-record/results.rb', line 147

def initialize(model_name, name)
  @model_name, @name = model_name, name
end

Instance Attribute Details

#model_nameObject (readonly)

Returns the value of attribute model_name.



144
145
146
# File 'lib/occams-record/results.rb', line 144

def model_name
  @model_name
end

#nameObject (readonly)

Returns the value of attribute name.



145
146
147
# File 'lib/occams-record/results.rb', line 145

def name
  @name
end

Instance Method Details

#messageObject



151
152
153
# File 'lib/occams-record/results.rb', line 151

def message
  "The column '#{name}' is unavailable on #{model_name} because it was not included in the SELECT statement!"
end