##// END OF EJS Templates
Fixed: ambiguous lft column SQL error on Issue#descendants with a join on projects....
Jean-Philippe Lang -
r5321:949b355ef213
parent child
Show More
@@ -164,6 +164,10 class IssueTest < ActiveSupport::TestCase
164 assert_equal [], projects.select {|p| !p.is_or_is_descendant_of?(project)}
164 assert_equal [], projects.select {|p| !p.is_or_is_descendant_of?(project)}
165 end
165 end
166
166
167 def test_visible_and_nested_set_scopes
168 assert_equal 0, Issue.find(1).descendants.visible.all.size
169 end
170
167 def test_errors_full_messages_should_include_custom_fields_errors
171 def test_errors_full_messages_should_include_custom_fields_errors
168 field = IssueCustomField.find_by_name('Database')
172 field = IssueCustomField.find_by_name('Database')
169
173
@@ -425,7 +425,7 module CollectiveIdea #:nodoc:
425 # the base ActiveRecord class, using the :scope declared in the acts_as_nested_set
425 # the base ActiveRecord class, using the :scope declared in the acts_as_nested_set
426 # declaration.
426 # declaration.
427 def nested_set_scope
427 def nested_set_scope
428 options = {:order => quoted_left_column_name}
428 options = {:order => "#{self.class.table_name}.#{quoted_left_column_name}"}
429 scopes = Array(acts_as_nested_set_options[:scope])
429 scopes = Array(acts_as_nested_set_options[:scope])
430 options[:conditions] = scopes.inject({}) do |conditions,attr|
430 options[:conditions] = scopes.inject({}) do |conditions,attr|
431 conditions.merge attr => self[attr]
431 conditions.merge attr => self[attr]
General Comments 0
You need to be logged in to leave comments. Login now