Patch by Redmine CRM.
git-svn-id: http://svn.redmine.org/redmine/trunk@14857
e93f8b46-1217-0410-a6f0-
8f06a7374b81
has_many :memberships,
lambda {preload(:project, :roles).
joins(:project).
- where("#{Project.table_name}.status<>#{Project::STATUS_ARCHIVED}").
- order("#{Project.table_name}.name")},
+ where("#{Project.table_name}.status<>#{Project::STATUS_ARCHIVED}")},
:class_name => 'Member',
:foreign_key => 'user_id'
has_many :projects, :through => :memberships
p.status = Project::STATUS_CLOSED
assert_include 'closed', p.css_classes.split
end
+
+ def test_combination_of_visible_and_uniq_scopes_in_case_anonymous_group_has_memberships_should_not_error
+ project = Project.find(1)
+ member = Member.create!(:project => project, :principal => Group.anonymous, :roles => [Role.generate!])
+ project.members << member
+ assert_nothing_raised do
+ Project.uniq.visible.to_a
+ end
+ end
end