Exception: DatabaseValidations::Errors::ForeignKeyNotFound

Inherits:
Base
  • Object
show all
Defined in:
lib/database_validations/lib/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#env_message

Constructor Details

#initialize(column, foreign_keys) ⇒ ForeignKeyNotFound

Returns a new instance of ForeignKeyNotFound.



58
59
60
61
62
63
# File 'lib/database_validations/lib/errors.rb', line 58

def initialize(column, foreign_keys)
  @column = column
  @foreign_keys = foreign_keys

  super "No foreign key found with column: \"#{column}\". Found foreign keys are: #{foreign_keys}. " + env_message
end

Instance Attribute Details

#columnObject (readonly)

Returns the value of attribute column.



56
57
58
# File 'lib/database_validations/lib/errors.rb', line 56

def column
  @column
end

#foreign_keysObject (readonly)

Returns the value of attribute foreign_keys.



56
57
58
# File 'lib/database_validations/lib/errors.rb', line 56

def foreign_keys
  @foreign_keys
end