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

Defined in:
lib/nested_set/base.rb

Overview

Mixed into both classes and instances to provide easy access to the column names

Instance Method Summary collapse

Instance Method Details

#depth_column_nameObject



325
326
327
# File 'lib/nested_set/base.rb', line 325

def depth_column_name
  acts_as_nested_set_options[:depth_column]
end

#left_column_nameObject



309
310
311
# File 'lib/nested_set/base.rb', line 309

def left_column_name
  acts_as_nested_set_options[:left_column]
end

#parent_column_nameObject



317
318
319
# File 'lib/nested_set/base.rb', line 317

def parent_column_name
  acts_as_nested_set_options[:parent_column]
end

#primary_key_column_nameObject



329
330
331
# File 'lib/nested_set/base.rb', line 329

def primary_key_column_name
  acts_as_nested_set_options[:primary_key_column]
end

#quoted_depth_column_nameObject



349
350
351
# File 'lib/nested_set/base.rb', line 349

def quoted_depth_column_name
  connection.quote_column_name(depth_column_name)
end

#quoted_left_column_nameObject



333
334
335
# File 'lib/nested_set/base.rb', line 333

def quoted_left_column_name
  connection.quote_column_name(left_column_name)
end

#quoted_parent_column_nameObject



341
342
343
# File 'lib/nested_set/base.rb', line 341

def quoted_parent_column_name
  connection.quote_column_name(parent_column_name)
end

#quoted_primary_key_column_nameObject



353
354
355
# File 'lib/nested_set/base.rb', line 353

def quoted_primary_key_column_name
  connection.quote_column_name(primary_key_column_name)
end

#quoted_right_column_nameObject



337
338
339
# File 'lib/nested_set/base.rb', line 337

def quoted_right_column_name
  connection.quote_column_name(right_column_name)
end

#quoted_scope_column_namesObject



345
346
347
# File 'lib/nested_set/base.rb', line 345

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

#right_column_nameObject



313
314
315
# File 'lib/nested_set/base.rb', line 313

def right_column_name
  acts_as_nested_set_options[:right_column]
end

#scope_column_namesObject



321
322
323
# File 'lib/nested_set/base.rb', line 321

def scope_column_names
  Array(acts_as_nested_set_options[:scope])
end