Sha256: 543c7faccecaf7f30a498793da471ace9019817d7949541b9e8259c6c1e74f42

Contents?: true

Size: 261 Bytes

Versions: 10

Compression:

Stored size: 261 Bytes

Contents

module Roachclip
  module Validations
    class ValidatesPresenceOf < Validatable::ValidationBase
      def valid?(instance)
        instance.send("#{attribute}?")
      end

      def message(instance)
        super || 'is required'
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
roachclip-0.3.2 lib/roachclip/validations.rb
roachclip-0.3.1 lib/roachclip/validations.rb
roachclip-0.3.0 lib/roachclip/validations.rb
roachclip-0.2.4 lib/roachclip/validations.rb
roachclip-0.2.3 lib/roachclip/validations.rb
roachclip-0.2.2 lib/roachclip/validations.rb
roachclip-0.2.1 lib/roachclip/validations.rb
roachclip-0.2.0 lib/roachclip/validations.rb
roachclip-0.1.3 lib/roachclip/validations.rb
roachclip-0.1.2 lib/roachclip/validations.rb