Module: TinySupport::ActiveRecord::NestedSet::Columns

Defined in:
lib/tiny_support/active_record/nested_set.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



770
771
772
# File 'lib/tiny_support/active_record/nested_set.rb', line 770

def depth_column_name
  acts_as_nested_set_options[:depth_column]
end

#left_column_nameObject



762
763
764
# File 'lib/tiny_support/active_record/nested_set.rb', line 762

def left_column_name
  acts_as_nested_set_options[:left_column]
end

#order_columnObject



778
779
780
# File 'lib/tiny_support/active_record/nested_set.rb', line 778

def order_column
  acts_as_nested_set_options[:order_column] || left_column_name
end

#parent_column_nameObject



774
775
776
# File 'lib/tiny_support/active_record/nested_set.rb', line 774

def parent_column_name
  acts_as_nested_set_options[:parent_column]
end

#quoted_depth_column_nameObject



794
795
796
# File 'lib/tiny_support/active_record/nested_set.rb', line 794

def quoted_depth_column_name
  connection.quote_column_name(depth_column_name)
end

#quoted_left_column_full_nameObject



806
807
808
# File 'lib/tiny_support/active_record/nested_set.rb', line 806

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

#quoted_left_column_nameObject



786
787
788
# File 'lib/tiny_support/active_record/nested_set.rb', line 786

def quoted_left_column_name
  connection.quote_column_name(left_column_name)
end

#quoted_parent_column_full_nameObject



814
815
816
# File 'lib/tiny_support/active_record/nested_set.rb', line 814

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

#quoted_parent_column_nameObject



798
799
800
# File 'lib/tiny_support/active_record/nested_set.rb', line 798

def quoted_parent_column_name
  connection.quote_column_name(parent_column_name)
end

#quoted_right_column_full_nameObject



810
811
812
# File 'lib/tiny_support/active_record/nested_set.rb', line 810

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

#quoted_right_column_nameObject



790
791
792
# File 'lib/tiny_support/active_record/nested_set.rb', line 790

def quoted_right_column_name
  connection.quote_column_name(right_column_name)
end

#quoted_scope_column_namesObject



802
803
804
# File 'lib/tiny_support/active_record/nested_set.rb', line 802

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

#right_column_nameObject



766
767
768
# File 'lib/tiny_support/active_record/nested_set.rb', line 766

def right_column_name
  acts_as_nested_set_options[:right_column]
end

#scope_column_namesObject



782
783
784
# File 'lib/tiny_support/active_record/nested_set.rb', line 782

def scope_column_names
  Array(acts_as_nested_set_options[:scope])
end