Class: Rpush::Client::ActiveModel::Gcm::ExpiryCollapseKeyMutualInclusionValidator

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

Instance Method Summary collapse

Instance Method Details

#validate(record) ⇒ Object


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

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