Class: Rpush::Client::ActiveModel::Adm::DataValidator

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

Instance Method Summary collapse

Instance Method Details

#validate(record) ⇒ Object


6
7
8
9
# File 'lib/rpush/client/active_model/adm/data_validator.rb', line 6

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