Module: CollectiveIdea::Acts::NestedSet::Columns

Defined in:
lib/awesome_nested_set/columns.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#counter_cache_column_nameObject



34
35
36
# File 'lib/awesome_nested_set/columns.rb', line 34

def counter_cache_column_name
  acts_as_nested_set_options[:counter_cache]
end

#depth_column_nameObject



14
15
16
# File 'lib/awesome_nested_set/columns.rb', line 14

def depth_column_name
  acts_as_nested_set_options[:depth_column]
end

#left_column_nameObject



6
7
8
# File 'lib/awesome_nested_set/columns.rb', line 6

def left_column_name
  acts_as_nested_set_options[:left_column]
end

#model_connectionObject



86
87
88
# File 'lib/awesome_nested_set/columns.rb', line 86

def model_connection
  self.is_a?(Class) ? self.connection : self.class.connection
end

#order_column_nameObject



26
27
28
# File 'lib/awesome_nested_set/columns.rb', line 26

def order_column_name
  acts_as_nested_set_options[:order_column] || left_column_name
end

#parent_column_nameObject



18
19
20
# File 'lib/awesome_nested_set/columns.rb', line 18

def parent_column_name
  acts_as_nested_set_options[:parent_column]
end

#primary_column_nameObject



22
23
24
# File 'lib/awesome_nested_set/columns.rb', line 22

def primary_column_name
  acts_as_nested_set_options[:primary_column]
end

#quoted_depth_column_nameObject



46
47
48
# File 'lib/awesome_nested_set/columns.rb', line 46

def quoted_depth_column_name
  model_connection.quote_column_name(depth_column_name)
end

#quoted_left_column_full_nameObject



74
75
76
# File 'lib/awesome_nested_set/columns.rb', line 74

def quoted_left_column_full_name
  "#{quoted_table_name}.#{quoted_left_column_name}"
end

#quoted_left_column_nameObject



38
39
40
# File 'lib/awesome_nested_set/columns.rb', line 38

def quoted_left_column_name
  model_connection.quote_column_name(left_column_name)
end

#quoted_order_column_full_nameObject



70
71
72
# File 'lib/awesome_nested_set/columns.rb', line 70

def quoted_order_column_full_name
  "#{quoted_table_name}.#{quoted_order_column_name}"
end

#quoted_order_column_nameObject



62
63
64
# File 'lib/awesome_nested_set/columns.rb', line 62

def quoted_order_column_name
  model_connection.quote_column_name(order_column_name)
end

#quoted_parent_column_full_nameObject



82
83
84
# File 'lib/awesome_nested_set/columns.rb', line 82

def quoted_parent_column_full_name
  "#{quoted_table_name}.#{quoted_parent_column_name}"
end

#quoted_parent_column_nameObject



54
55
56
# File 'lib/awesome_nested_set/columns.rb', line 54

def quoted_parent_column_name
  model_connection.quote_column_name(parent_column_name)
end

#quoted_primary_column_nameObject



50
51
52
# File 'lib/awesome_nested_set/columns.rb', line 50

def quoted_primary_column_name
  model_connection.quote_column_name(primary_column_name)
end

#quoted_primary_key_column_full_nameObject



66
67
68
# File 'lib/awesome_nested_set/columns.rb', line 66

def quoted_primary_key_column_full_name
  "#{quoted_table_name}.#{quoted_primary_column_name}"
end

#quoted_right_column_full_nameObject



78
79
80
# File 'lib/awesome_nested_set/columns.rb', line 78

def quoted_right_column_full_name
  "#{quoted_table_name}.#{quoted_right_column_name}"
end

#quoted_right_column_nameObject



42
43
44
# File 'lib/awesome_nested_set/columns.rb', line 42

def quoted_right_column_name
  model_connection.quote_column_name(right_column_name)
end

#quoted_scope_column_namesObject



58
59
60
# File 'lib/awesome_nested_set/columns.rb', line 58

def quoted_scope_column_names
  scope_column_names.collect {|column_name| connection.quote_column_name(column_name) }
end

#right_column_nameObject



10
11
12
# File 'lib/awesome_nested_set/columns.rb', line 10

def right_column_name
  acts_as_nested_set_options[:right_column]
end

#scope_column_namesObject



30
31
32
# File 'lib/awesome_nested_set/columns.rb', line 30

def scope_column_names
  Array(acts_as_nested_set_options[:scope])
end