Class: Rapns::Gcm::RegistrationIdsCountValidator

Inherits:
ActiveModel::Validator
  • Object
show all
Defined in:
lib/rapns/gcm/registration_ids_count_validator.rb

Constant Summary collapse

LIMIT =
1000

Instance Method Summary collapse

Instance Method Details

#validate(record) ⇒ Object



6
7
8
9
10
# File 'lib/rapns/gcm/registration_ids_count_validator.rb', line 6

def validate(record)
  if record.registration_ids && record.registration_ids.size > LIMIT
    record.errors[:base] << "GCM notification number of registration_ids cannot be larger than #{LIMIT}."
  end
end