Module: ActiveRecord::Defaults

Defined in:
lib/active_record/defaults.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods Classes: Default

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/active_record/defaults.rb', line 3

def self.included(base)
  return if base.included_modules.include?(ActiveRecord::Defaults::InstanceMethods)
  
  base.extend ClassMethods
  base.send(:include, InstanceMethods)
  
  base.send :alias_method, :initialize_without_defaults, :initialize
  base.send :alias_method, :initialize, :initialize_with_defaults
end