Class: Rpush::Gcm::ExpiryCollapseKeyMutualInclusionValidator

Inherits:
ActiveModel::Validator
  • Object
show all
Defined in:
lib/rpush/gcm/expiry_collapse_key_mutual_inclusion_validator.rb

Instance Method Summary collapse

Instance Method Details

#validate(record) ⇒ Object



4
5
6
7
8
# File 'lib/rpush/gcm/expiry_collapse_key_mutual_inclusion_validator.rb', line 4

def validate(record)
  if record.collapse_key && !record.expiry
    record.errors[:expiry] << "must be set when using a collapse_key"
  end
end