canvas-lms/gems/acts_as_list
Cody Cutrer 6d6d09c3e0 bundle update sqlite3
Change-Id: If943867d8f514d1573ef974508f3f6c5eb3415d2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/325279
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Build-Review: Cody Cutrer <cody@instructure.com>
2023-08-15 20:20:26 +00:00
..
lib rubocop: Style/TernaryParentheses, Style/RedundantParentheses 2023-04-12 14:56:48 +00:00
spec rubocop: prep for updating rubocop-rspec 2023-04-12 19:30:10 +00:00
Gemfile RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
Gemfile.lock bundle update sqlite3 2023-08-15 20:20:26 +00:00
README
acts_as_list.gemspec fix lockfile syncing from canvas lockfile to sub-gems 2023-05-09 22:57:42 +00:00
test.sh spec: use rspec to run acts_as_list tests 2019-09-05 15:17:33 +00:00

README

ActsAsList
==========

This acts_as extension provides the capabilities for sorting and reordering a number of objects in a list. The class that has this specified needs to have a +position+ column defined as an integer on the mapped database table.


Example
=======

  class TodoList < ActiveRecord::Base
    has_many :todo_items, :order => "position"
  end

  class TodoItem < ActiveRecord::Base
    belongs_to :todo_list
    acts_as_list :scope => :todo_list
  end

  todo_list.first.move_to_bottom
  todo_list.last.insert_at(2)


Copyright (c) 2007 David Heinemeier Hansson, released under the MIT license