Sha256: 0c5ef0f748f67617ba724c9e0a03d22e33c28a1659f4076bec5c70af941e55f5

Contents?: true

Size: 313 Bytes

Versions: 4

Compression:

Stored size: 313 Bytes

Contents

module CitizenBudgetModel
  # @see https://github.com/globalize/globalize-accessors/issues/8
  class LocaleValidator < ActiveModel::EachValidator
    def validate_each(record, attribute, value)
      unless record.in_any_locale?(attribute)
        record.errors.add(attribute, :blank)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
citizen_budget_model-0.0.4 app/validators/citizen_budget_model/locale_validator.rb
citizen_budget_model-0.0.3 app/validators/citizen_budget_model/locale_validator.rb
citizen_budget_model-0.0.2 app/validators/citizen_budget_model/locale_validator.rb
citizen_budget_model-0.0.1 app/validators/citizen_budget_model/locale_validator.rb