Class: TableWarnings::Blank

Inherits:
Exclusive show all
Defined in:
lib/table_warnings/blank.rb

Instance Attribute Summary

Attributes inherited from Exclusive

#conditions, #scout, #table

Instance Method Summary collapse

Methods inherited from Exclusive

#covers, #exclusives, #initialize, #matches, #messages

Constructor Details

This class inherits a constructor from TableWarnings::Exclusive

Instance Method Details

#message(column) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/table_warnings/blank.rb', line 3

def message(column)
  if column.nulls?(conditions) or (column.string? and column.blanks?(conditions))
    if conditions.empty?
      "There are blanks in the #{column.name.inspect} column."
    else
      "There are blanks with the condition #{conditions.inspect} in the #{column.name.inspect} column."
    end
  end
end