Module: Julik::MakeLikeTree

Defined in:
lib/make_like_a_tree.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods Classes: ImpossibleReparent

Constant Summary collapse

VERSION =
'1.0.3'
DEFAULTS =
{ 
  :root_column => "root_id", 
  :parent_column => "parent_id", 
  :left_column => "lft", 
  :right_column => "rgt", 
  :depth_column => 'depth', 
  :scope => "(1=1)"
}

Class Method Summary collapse

Class Method Details

.bootstrap!Object

Injects the module into ActiveRecord. Can (and should) be used in config.after_initialize block of the app



23
24
25
# File 'lib/make_like_a_tree.rb', line 23

def self.bootstrap!
  ::ActiveRecord::Base.send :include, self
end

.included(base) ⇒ Object

:nodoc:



16
17
18
19
# File 'lib/make_like_a_tree.rb', line 16

def self.included(base) #:nodoc:
  super
  base.extend(ClassMethods)
end