# File lib/better_nested_set.rb, line 254
254:         def level
255:             return 0 if self[acts_as_nested_set_options[:parent_column]].nil?
256:             self.class.count("#{acts_as_nested_set_options[:scope]} AND (#{acts_as_nested_set_options[:left_column]} < #{self[acts_as_nested_set_options[:left_column]]} and #{acts_as_nested_set_options[:right_column]} > #{self[acts_as_nested_set_options[:right_column]]})")
257:         end