Sha256: 70f2d2b338eeeb82e210610956bfacbb7367f30999d965566255293a15d51d3e

Contents?: true

Size: 414 Bytes

Versions: 49

Compression:

Stored size: 414 Bytes

Contents

module Rpush
  module Client
    module ActiveModel
      class RegistrationIdsCountValidator < ::ActiveModel::Validator
        def validate(record)
          limit = options[:limit] || 100
          return unless record.registration_ids && record.registration_ids.size > limit
          record.errors[:base] << "Number of registration_ids cannot be larger than #{limit}."
        end
      end
    end
  end
end

Version data entries

49 entries across 49 versions & 2 rubygems

Version Path
rpush-5.2.0 lib/rpush/client/active_model/registration_ids_count_validator.rb
rpush-5.1.0 lib/rpush/client/active_model/registration_ids_count_validator.rb
rpush-5.0.0 lib/rpush/client/active_model/registration_ids_count_validator.rb
rpush-4.2.0 lib/rpush/client/active_model/registration_ids_count_validator.rb
rpush-4.1.1 lib/rpush/client/active_model/registration_ids_count_validator.rb
rpush-4.1.0 lib/rpush/client/active_model/registration_ids_count_validator.rb
rpush-4.0.1 lib/rpush/client/active_model/registration_ids_count_validator.rb
rpush-4.0.0 lib/rpush/client/active_model/registration_ids_count_validator.rb
rpush-3.3.1 lib/rpush/client/active_model/registration_ids_count_validator.rb
rpush-3.3.0 lib/rpush/client/active_model/registration_ids_count_validator.rb
rpush_extended-3.2.6 lib/rpush/client/active_model/registration_ids_count_validator.rb
rpush_extended-3.2.5 lib/rpush/client/active_model/registration_ids_count_validator.rb
rpush-3.2.4 lib/rpush/client/active_model/registration_ids_count_validator.rb
rpush-3.2.3 lib/rpush/client/active_model/registration_ids_count_validator.rb
rpush-3.2.2 lib/rpush/client/active_model/registration_ids_count_validator.rb
rpush-3.2.1 lib/rpush/client/active_model/registration_ids_count_validator.rb
rpush-3.2.0 lib/rpush/client/active_model/registration_ids_count_validator.rb
rpush-3.1.1 lib/rpush/client/active_model/registration_ids_count_validator.rb
rpush-3.1.0 lib/rpush/client/active_model/registration_ids_count_validator.rb
rpush-3.0.2 lib/rpush/client/active_model/registration_ids_count_validator.rb