Exception: ResolveJoinReferenceError

Inherits:
JoinFixError
  • Object
show all
Defined in:
lib/joinfix/error.rb

Overview

:nodoc:

Direct Known Subclasses

ForeignKeySetError

Instance Attribute Summary collapse

Attributes inherited from JoinFixError

#advice, #entry_name, #fixtures, #msg

Instance Method Summary collapse

Methods inherited from JoinFixError

new

Constructor Details

#initialize(fixtures, entry_name, join_table_name, join_name, msg = nil) ⇒ ResolveJoinReferenceError

Returns a new instance of ResolveJoinReferenceError.



126
127
128
129
130
# File 'lib/joinfix/error.rb', line 126

def initialize(fixtures, entry_name, join_table_name, join_name, msg=nil)
  super(fixtures, entry_name, msg)
	@join_table_name = join_table_name
	@join_name = join_name
end

Instance Attribute Details

#join_nameObject (readonly)

Returns the value of attribute join_name.



124
125
126
# File 'lib/joinfix/error.rb', line 124

def join_name
  @join_name
end

#join_table_nameObject (readonly)

Returns the value of attribute join_table_name.



124
125
126
# File 'lib/joinfix/error.rb', line 124

def join_table_name
  @join_table_name
end

Instance Method Details

#messageObject



132
133
134
135
136
137
138
# File 'lib/joinfix/error.rb', line 132

def message
	"Cannot resolve reference to <#{join_table_name}(:#{join_name})> " + 
	"for <#{fixtures.klass.table_name}(:#{entry_name})> " + 
	"in <#{fixtures.fixture_path}>.\n" +
	(msg.nil? ? '' : "\n#{msg}\n") +
	(advice.nil? ? '' : "#{advice}\n")
end