Make it possible to use a regular scope string in addition to the symbol shortcut

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@181 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson 2004-12-16 13:22:57 +00:00
parent cf718eb707
commit 2dbff3fbc0
1 changed files with 5 additions and 1 deletions

View File

@ -45,7 +45,11 @@ module ActiveRecord
end
def scope_condition
"#{configuration[:scope]} = \#{#{configuration[:scope]}}"
if configuration[:scope].is_a?(Symbol)
"#{configuration[:scope]} = \#{#{configuration[:scope]}}"
else
configuration[:scope]
end
end
before_destroy :remove_from_list