module Rethinker::Document::Validation

Public Instance Methods

save(options={}) click to toggle source
Calls superclass method
# File lib/rethinker/document/validation.rb, line 6
def save(options={})
  options = options.reverse_merge(:validate => true)

  if options[:validate]
    valid? ? super : false
  else
    super
  end
end
valid?(context=nil) click to toggle source

TODO Test that thing

Calls superclass method
# File lib/rethinker/document/validation.rb, line 17
def valid?(context=nil)
  super(context || (new_record? ? :create : :update))
end