Class: PaidUp::Validators::TableRows
- Inherits:
-
ActiveModel::Validator
- Object
- ActiveModel::Validator
- PaidUp::Validators::TableRows
- Defined in:
- lib/paid_up/validators/table_rows.rb
Instance Method Summary collapse
Instance Method Details
#validate(record) ⇒ Object
3 4 5 6 7 |
# File 'lib/paid_up/validators/table_rows.rb', line 3 def validate(record) if record.send([:field]) == [:comparison] && !ActiveRecord::Base.connection.table_exists?(record.send([:found_in])) record.errors[[:found_in]] << :when_using_table_rows_table_must_exist.l end end |