提交 04d032ed 编写于 作者: D David Heinemeier Hansson

scope_condition defaults to 1 on list mixin

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@89 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 14b4040a
......@@ -5,8 +5,8 @@ module ActiveRecord
module Mixins
# This mixin provides the capabilities for sorting and reordering a number of objects in list.
# The class that has this mixin included needs to have a "position" column defined as an integer on
# the mapped database table. Further more, you need to implement the <tt>scope_condition</tt> that
# defines how to separate one list from another.
# the mapped database table. Further more, you need to implement the <tt>scope_condition</tt> if you want
# to separate one list from another.
#
# Todo list example:
#
......@@ -98,7 +98,7 @@ def last?
private
# Overwrite this method to define the scope of the list changes
def scope_condition; end
def scope_condition() "1" end
def higher_item
self.class.find_first(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册