Sha256: 8afdc4146e4e69ee342406f8060de560a5697451d620a751a2f14a59ebf524ae

Contents?: true

Size: 434 Bytes

Versions: 10

Compression:

Stored size: 434 Bytes

Contents

module Arpa
  module Validators
    class RoleValidator
      include ActiveModel::Validations

      attr_reader :name, :description, :action_ids

      validates :name, :description, presence: true
      validates :action_ids, presence: { message: :many_blank }


      def initialize(role)
        @name        = role.name
        @description = role.description
        @action_ids  = role.action_ids
      end

    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
arpa-0.2.0 lib/arpa/validators/role_validator.rb
arpa-0.1.0 lib/arpa/validators/role_validator.rb
arpa-0.0.9 lib/arpa/validators/role_validator.rb
arpa-0.0.8 lib/arpa/validators/role_validator.rb
arpa-0.0.7 lib/arpa/validators/role_validator.rb
arpa-0.0.6 lib/arpa/validators/role_validator.rb
arpa-0.0.5 lib/arpa/validators/role_validator.rb
arpa-0.0.4 lib/arpa/validators/role_validator.rb
arpa-0.0.3 lib/arpa/validators/role_validator.rb
arpa-0.0.2 lib/arpa/validators/role_validator.rb