Sha256: 60b451e78f868d9bb1c8d44cc4f6bdfa9210bdbb220934e87ddfecb993accaa3

Contents?: true

Size: 405 Bytes

Versions: 7

Compression:

Stored size: 405 Bytes

Contents

require 'validatable'

module CouchTomato
  module Persistence
    module Validation
      def self.included(base)
        base.send :include, Validatable
        base.class_eval do
          # Override the validate method to first run before_validation callback
          def valid?
            self.run_callbacks :before_validation
            super
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
couch_tomato-0.2.0 lib/couch_tomato/persistence/validation.rb
couch_tomato-0.1.5 lib/couch_tomato/persistence/validation.rb
couch_tomato-0.1.4 lib/couch_tomato/persistence/validation.rb
couch_tomato-0.1.3 lib/couch_tomato/persistence/validation.rb
couch_tomato-0.1.2 lib/couch_tomato/persistence/validation.rb
couch_tomato-0.1.1 lib/couch_tomato/persistence/validation.rb
couch_tomato-0.1.0 lib/couch_tomato/persistence/validation.rb