aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/acts
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-01-11 00:13:42 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-01-11 00:13:42 +0000
commita971dc5e4aa45f747d375c3703fadc5d1568c876 (patch)
tree3e8879af728a8affc6b9a3ad03766d56bce5d919 /activerecord/lib/active_record/acts
parentdbb5341691bf1528a3079e20ea88a521787068ed (diff)
downloadrails-a971dc5e4aa45f747d375c3703fadc5d1568c876.tar.gz
rails-a971dc5e4aa45f747d375c3703fadc5d1568c876.tar.bz2
rails-a971dc5e4aa45f747d375c3703fadc5d1568c876.zip
Fixed default scope of acts_as_list from "1" to "1 = 1", so itll work in PostgreSQL (among other places) #427 [Alexey]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@380 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record/acts')
-rw-r--r--activerecord/lib/active_record/acts/list.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/acts/list.rb b/activerecord/lib/active_record/acts/list.rb
index 3c0105bbe6..b5cffbb427 100644
--- a/activerecord/lib/active_record/acts/list.rb
+++ b/activerecord/lib/active_record/acts/list.rb
@@ -31,7 +31,7 @@ module ActiveRecord
# as the foreign key restriction. It's also possible to give it an entire string that is interpolated if you need a tighter scope than
# just a foreign key. Example: <tt>acts_as_list :scope => 'todo_list_id = #{todo_list_id} AND completed = 0'</tt>
def acts_as_list(options = {})
- configuration = { :column => "position", :scope => "1" }
+ configuration = { :column => "position", :scope => "1 = 1" }
configuration.update(options) if options.is_a?(Hash)
configuration[:scope] = "#{configuration[:scope]}_id".intern if configuration[:scope].is_a?(Symbol) && configuration[:scope].to_s !~ /_id$/