# File lib/better_nested_set.rb, line 139 139: def before_create 140: maxright = self.class.count_by_sql("SELECT max(\"#{acts_as_nested_set_options[:right_column]}\") FROM "+self.class.table_name) 141: # adds the new node to the right of all existing nodes 142: self[acts_as_nested_set_options[:left_column]] = maxright+1 143: self[acts_as_nested_set_options[:right_column]] = maxright+2 144: end