Module: CouchSurfer::Validations

Defined in:
lib/couch_surfer/validations.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(receiver) ⇒ Object



38
39
40
41
42
43
44
45
46
47
# File 'lib/couch_surfer/validations.rb', line 38

def self.included(receiver)
  receiver.extend ClassMethods
  receiver.send :include, Validatable
  receiver.send :include, InstanceMethods
  receiver.class_eval do
    [:save].each do |method|
      before method, :validate_instance
    end
  end
end