Commit c1a71bf1 authored by jplang's avatar jplang

Fixed: ambiguous lft column SQL error on Issue#descendants with a join on projects.

git-svn-id: https://svn.redmine.org/redmine/trunk@5441 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 0795dd75
......@@ -164,6 +164,10 @@ class IssueTest < ActiveSupport::TestCase
assert_equal [], projects.select {|p| !p.is_or_is_descendant_of?(project)}
end
def test_visible_and_nested_set_scopes
assert_equal 0, Issue.find(1).descendants.visible.all.size
end
def test_errors_full_messages_should_include_custom_fields_errors
field = IssueCustomField.find_by_name('Database')
......
......@@ -425,7 +425,7 @@ module CollectiveIdea #:nodoc:
# the base ActiveRecord class, using the :scope declared in the acts_as_nested_set
# declaration.
def nested_set_scope
options = {:order => quoted_left_column_name}
options = {:order => "#{self.class.table_name}.#{quoted_left_column_name}"}
scopes = Array(acts_as_nested_set_options[:scope])
options[:conditions] = scopes.inject({}) do |conditions,attr|
conditions.merge attr => self[attr]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment