Sha256: 9f7d79a4a2519ab3ae79466839e372cd2782963e98b8f2f026b78f9e0c9b2f4a
Contents?: true
Size: 602 Bytes
Versions: 11
Compression:
Stored size: 602 Bytes
Contents
require 'active_model' require 'active_model/translation' module CouchPotato module Validation module ValidationContext def valid?(context = nil) context ||= new? ? :create : :update super context end end def self.included(base) #:nodoc: base.send :include, ::ActiveModel::Validations base.send :include, ::ActiveModel::Validations::Callbacks base.send :include, ValidationContext end end end # provide same interface to errors object as in Validatable module ::ActiveModel class Errors def errors self end end end
Version data entries
11 entries across 11 versions & 1 rubygems