Sha256: 2bb43a78d30090d25274eecf0f3d98a9fa889740e17b2ac2fb6bc249f4ede5e0

Contents?: true

Size: 236 Bytes

Versions: 14

Compression:

Stored size: 236 Bytes

Contents

module Validatable
  class ValidatesAcceptanceOf < ValidationBase #:nodoc:
    def valid?(instance)
      instance.send(self.attribute) == "true"
    end
    
    def message(instance)
      super || "must be accepted"
    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
mack-notifier-0.8.2 lib/gems/validatable-1.6.7/lib/validations/validates_acceptance_of.rb
mack-notifier-0.8.3 lib/gems/validatable-1.6.7/lib/validations/validates_acceptance_of.rb
mack-notifier-0.8.3.1 lib/gems/validatable-1.6.7/lib/validations/validates_acceptance_of.rb
validatable-1.3.4 lib/validations/validates_acceptance_of.rb
validatable-1.5.0 lib/validations/validates_acceptance_of.rb
validatable-1.6.7 lib/validations/validates_acceptance_of.rb
validatable-1.4.0 lib/validations/validates_acceptance_of.rb
validatable-1.5.2 lib/validations/validates_acceptance_of.rb
validatable-1.6.1 lib/validations/validates_acceptance_of.rb
validatable-1.6.3 lib/validations/validates_acceptance_of.rb
validatable-1.6.4 lib/validations/validates_acceptance_of.rb
validatable-1.6.6 lib/validations/validates_acceptance_of.rb
validatable-1.6.0 lib/validations/validates_acceptance_of.rb
validatable-1.6.2 lib/validations/validates_acceptance_of.rb