Class: ClarkKent::ReportColumnValidator

Inherits:
ActiveModel::Validator
  • Object
show all
Defined in:
app/validators/clark_kent/report_column_validator.rb

Instance Method Summary collapse

Instance Method Details

#validate(record) ⇒ Object



3
4
5
6
7
# File 'app/validators/clark_kent/report_column_validator.rb', line 3

def validate(record)
  if record.report_sort.present?
    record.errors[:report_sort] << "This column is not sortable." unless record.sortable?
  end
end