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.



47
48
49
50
51
52
# File 'lib/database_validations/lib/errors.rb', line 47

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.



45
46
47
# File 'lib/database_validations/lib/errors.rb', line 45

def column
  @column
end

#foreign_keysObject (readonly)

Returns the value of attribute foreign_keys.



45
46
47
# File 'lib/database_validations/lib/errors.rb', line 45

def foreign_keys
  @foreign_keys
end