Module: ClosureTree::DeterministicOrdering

Defined in:
lib/closure_tree/deterministic_ordering.rb

Instance Method Summary collapse

Instance Method Details

#order_valueObject



3
4
5
# File 'lib/closure_tree/deterministic_ordering.rb', line 3

def order_value
  read_attribute(_ct.order_column_sym)
end

#order_value=(new_order_value) ⇒ Object



7
8
9
# File 'lib/closure_tree/deterministic_ordering.rb', line 7

def order_value=(new_order_value)
  write_attribute(_ct.order_column_sym, new_order_value)
end

#siblings_afterObject



15
16
17
# File 'lib/closure_tree/deterministic_ordering.rb', line 15

def siblings_after
  siblings.where(["#{_ct.quoted_order_column} > ?", order_value])
end

#siblings_beforeObject



11
12
13
# File 'lib/closure_tree/deterministic_ordering.rb', line 11

def siblings_before
  siblings.where(["#{_ct.quoted_order_column} < ?", order_value])
end