Class: CanCamel::Node
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- CanCamel::Node
show all
- Defined in:
- lib/can_camel/node.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.with_parents ⇒ Object
7
8
9
|
# File 'lib/can_camel/node.rb', line 7
def self.with_parents
joins("LEFT JOIN #{TABLE_NAME} AS parents ON #{TABLE_NAME}.parent_id = parents.id")
end
|
Instance Method Details
#inherit!(source = nil) ⇒ Object
11
12
13
14
15
16
17
18
|
# File 'lib/can_camel/node.rb', line 11
def inherit!(source = nil)
return if inherited
@inherited = true
return inherit_source! source if source
inherit_source! parent if respond_to? :parent
inherit_source! inherited_node
end
|
#name ⇒ Object
24
25
26
|
# File 'lib/can_camel/node.rb', line 24
def name
super.to_sym
end
|