Class: TableWarnings::NonexistentOwner
- Defined in:
- lib/table_warnings/nonexistent_owner.rb
Instance Attribute Summary
Attributes inherited from Exclusive
Instance Method Summary collapse
-
#initialize(table, matcher, options = {}) ⇒ NonexistentOwner
constructor
A new instance of NonexistentOwner.
- #message(column) ⇒ Object
Methods inherited from Exclusive
#covers, #exclusives, #matches, #messages
Constructor Details
#initialize(table, matcher, options = {}) ⇒ NonexistentOwner
Returns a new instance of NonexistentOwner.
3 4 5 6 7 |
# File 'lib/table_warnings/nonexistent_owner.rb', line 3 def initialize(table, matcher, = {}) super scout.enable_association_check! @allow_null_query = [:allow_null] end |
Instance Method Details
#message(column) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/table_warnings/nonexistent_owner.rb', line 9 def (column) if column.nonexistent_owners?(conditions) or (not allow_null? and column.nulls?(conditions)) if conditions.empty? "Values in foreign key column #{column.name.inspect}#{null_warning} do not correspond to actual values in foreign table." else "Values in foreign key column #{column.name.inspect} under condition #{conditions.inspect}#{null_warning} do not correspond to actual values in foreign table." end end end |