Sha256: 6cb575af96815813640f1e26c21b6d1fc781ffde5fc518d78d86a5e85d7a68b1

Contents?: true

Size: 359 Bytes

Versions: 59

Compression:

Stored size: 359 Bytes

Contents

module Xeroizer
  module Record
    
    class Validator
  
      class PresenceOfValidator < Validator
        
        def valid?(record)
          if record[attribute].nil? || record[attribute].to_s == ''
            record.errors << [attribute, options[:message] || "can't be blank"]
          end
        end
        
      end
  
    end
    
  end
end

Version data entries

59 entries across 59 versions & 3 rubygems

Version Path
xeroizer-3.0.1 lib/xeroizer/record/validators/presence_of_validator.rb
xeroizer-3.0.0 lib/xeroizer/record/validators/presence_of_validator.rb
xeroizer-3-pre-beta-3.0.0.pre.beta lib/xeroizer/record/validators/presence_of_validator.rb
xeroizer-2.20.0 lib/xeroizer/record/validators/presence_of_validator.rb
xeroizer-2.19.0 lib/xeroizer/record/validators/presence_of_validator.rb
xeroizer-2.18.1 lib/xeroizer/record/validators/presence_of_validator.rb
xeroizer-2.17.1 lib/xeroizer/record/validators/presence_of_validator.rb
xeroizer-2.16.5 lib/xeroizer/record/validators/presence_of_validator.rb
xeroizer-2.16.4 lib/xeroizer/record/validators/presence_of_validator.rb
xeroizer-2.16.3 lib/xeroizer/record/validators/presence_of_validator.rb
xeroizer-2.16.1 lib/xeroizer/record/validators/presence_of_validator.rb
xeroizer-2.16.0 lib/xeroizer/record/validators/presence_of_validator.rb
xeroizer-2.15.9 lib/xeroizer/record/validators/presence_of_validator.rb
xeroizer-2.15.8 lib/xeroizer/record/validators/presence_of_validator.rb
xeroizer-2.15.7 lib/xeroizer/record/validators/presence_of_validator.rb
xeroizer-2.15.6 lib/xeroizer/record/validators/presence_of_validator.rb
xeroizer-float-2.15.5.2 lib/xeroizer/record/validators/presence_of_validator.rb
xeroizer-float-2.15.5.1 lib/xeroizer/record/validators/presence_of_validator.rb
xeroizer-2.15.5 lib/xeroizer/record/validators/presence_of_validator.rb
xeroizer-float-2.15.3.16 lib/xeroizer/record/validators/presence_of_validator.rb