Module: ObjectDaddy

Defined in:
lib/object_daddy.rb

Defined Under Namespace

Modules: ClassMethods, RailsClassMethods

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/object_daddy.rb', line 3

def self.included(klass)
  klass.extend ClassMethods
  if defined? ActiveRecord and klass < ActiveRecord::Base
    klass.extend RailsClassMethods    
    
    class << klass
      alias_method :validates_presence_of_without_object_daddy, :validates_presence_of
      alias_method :validates_presence_of, :validates_presence_of_with_object_daddy
    end   
  end
end