Class: CanCamel::Node

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/can_camel/node.rb

Direct Known Subclasses

ActionNode, ConcernNode, GroupNode, SubjectNode

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.with_parentsObject



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

#nameObject

accessors



24
25
26
# File 'lib/can_camel/node.rb', line 24

def name
  super.to_sym
end