Module: ActsAsList::Mongoid::ClassMethods

Defined in:
lib/mongoid/acts_as_list.rb

Instance Method Summary collapse

Instance Method Details

#in_scopeObject



54
55
56
# File 'lib/mongoid/acts_as_list.rb', line 54

def in_scope
  where(scope_condition)
end

#move_commands(symbol) ⇒ Object



58
59
60
61
62
63
64
65
66
67
# File 'lib/mongoid/acts_as_list.rb', line 58

def move_commands symbol
  case symbol
  when :symbol
    [:highest, :top, :lowest, :bottom, :up, :higher, :down, :lower]
  when :hash
    [:to, :above, :below]
  else
    raise ArgumentError, "no move_commands defined for: #{symbol}"
  end
end