Class: CitizenBudgetModel::LocaleValidator

Inherits:
ActiveModel::EachValidator
  • Object
show all
Defined in:
app/validators/citizen_budget_model/locale_validator.rb

Overview

Instance Method Summary collapse

Instance Method Details

#validate_each(record, attribute, value) ⇒ Object



4
5
6
7
8
# File 'app/validators/citizen_budget_model/locale_validator.rb', line 4

def validate_each(record, attribute, value)
  unless record.in_any_locale?(attribute)
    record.errors.add(attribute, :blank)
  end
end