Class: Rpush::Adm::DataValidator

Inherits:
ActiveModel::Validator
  • Object
show all
Defined in:
lib/rpush/adm/data_validator.rb

Instance Method Summary collapse

Instance Method Details

#validate(record) ⇒ Object



4
5
6
7
8
# File 'lib/rpush/adm/data_validator.rb', line 4

def validate(record)
  if record.collapse_key.nil? && record.data.nil?
    record.errors[:data] << "must be set unless collapse_key is specified"
  end
end