Sha256: f453026482fb2dae5d2f25c1e88153f88bf349b4796b16bc634f551574088f9b

Contents?: true

Size: 254 Bytes

Versions: 46

Compression:

Stored size: 254 Bytes

Contents

module Validatable
  class ValidatesTrueFor < ValidationBase #:nodoc:
    required_option :logic
  
    def valid?(instance)
      instance.instance_eval(&logic) == true
    end
    
    def message(instance)
      super || "is invalid"
    end
  end
end

Version data entries

46 entries across 46 versions & 12 rubygems

Version Path
hashrocket-validatable-1.7.2 lib/validations/validates_true_for.rb
hashrocket-validatable-1.7.4 lib/validations/validates_true_for.rb
jnunemaker-validatable-1.7.0 lib/validations/validates_true_for.rb
jnunemaker-validatable-1.7.1 lib/validations/validates_true_for.rb
jnunemaker-validatable-1.7.2 lib/validations/validates_true_for.rb
vizjerai-validatable-1.8.0 lib/validations/validates_true_for.rb
vizjerai-validatable-1.9.0 lib/validations/validates_true_for.rb
lgustafson-validatable-1.8.7 lib/validatable/validations/validates_true_for.rb
lgustafson-validatable-1.8.6 lib/validatable/validations/validates_true_for.rb
np422-validatable-1.8.5 lib/validatable/validations/validates_true_for.rb
validatable2-0.0.2 lib/validatable/validations/validates_true_for.rb
validatable2-0.0.1 lib/validatable/validations/validates_true_for.rb
erotte-validatable-1.8.5 lib/validatable/validations/validates_true_for.rb
mongomatic-0.0.2 lib/validatable/validations/validates_true_for.rb
mattmatt-validatable-1.8.3 lib/validatable/validations/validates_true_for.rb
jnunemaker-validatable-1.8.4 lib/validatable/validations/validates_true_for.rb
jnunemaker-validatable-1.8.3 lib/validatable/validations/validates_true_for.rb
jnunemaker-validatable-1.8.2 lib/validatable/validations/validates_true_for.rb
jnunemaker-validatable-1.1.10 lib/validatable/validations/validates_true_for.rb
jnunemaker-validatable-1.1.9 lib/validatable/validations/validates_true_for.rb