Module: CouchTomato::Persistence::Validation

Defined in:
lib/couch_tomato/persistence/validation.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/couch_tomato/persistence/validation.rb', line 6

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