Sha256: 22358ea388ee0280adf6bf76fb00414ca754fd5b4fcb4ed67f871bc2e314feeb

Contents?: true

Size: 405 Bytes

Versions: 9

Compression:

Stored size: 405 Bytes

Contents

require 'validatable'

module CouchPotato
  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

9 entries across 9 versions & 3 rubygems

Version Path
andrewtimberlake-couch_potato-0.2.8.1 lib/couch_potato/persistence/validation.rb
andrewtimberlake-couch_potato-0.2.8.2 lib/couch_potato/persistence/validation.rb
andrewtimberlake-couch_potato-0.2.8.3 lib/couch_potato/persistence/validation.rb
andrewtimberlake-couch_potato-0.2.8.4 lib/couch_potato/persistence/validation.rb
langalex-couch_potato-0.2.11 lib/couch_potato/persistence/validation.rb
langalex-couch_potato-0.2.12 lib/couch_potato/persistence/validation.rb
langalex-couch_potato-0.2.8 lib/couch_potato/persistence/validation.rb
langalex-couch_potato-0.2.9 lib/couch_potato/persistence/validation.rb
couch_potato-0.2.12 lib/couch_potato/persistence/validation.rb