Defect #21182 » fix_project_uniq_visible.diff
public/stylesheets/application.css | ||
---|---|---|
1110 | 1110 |
padding: 5px; |
1111 | 1111 |
} |
1112 | 1112 | |
1113 |
div.issue table img.gravatar {
|
|
1113 |
div.issue .attributes img.gravatar {
|
|
1114 | 1114 |
height: 14px; |
1115 | 1115 |
width: 14px; |
1116 | 1116 |
padding: 2px; |
1117 |
- |
app/models/principal.rb | ||
---|---|---|
28 | 28 |
has_many :memberships, |
29 | 29 |
lambda {preload(:project, :roles). |
30 | 30 |
joins(:project). |
31 |
where("#{Project.table_name}.status<>#{Project::STATUS_ARCHIVED}"). |
|
32 |
order("#{Project.table_name}.name")}, |
|
31 |
where("#{Project.table_name}.status<>#{Project::STATUS_ARCHIVED}")}, |
|
33 | 32 |
:class_name => 'Member', |
34 | 33 |
:foreign_key => 'user_id' |
35 | 34 |
has_many :projects, :through => :memberships |
test/unit/project_test.rb | ||
---|---|---|
991 | 991 |
p.status = Project::STATUS_CLOSED |
992 | 992 |
assert_include 'closed', p.css_classes.split |
993 | 993 |
end |
994 | ||
995 |
def test_combination_of_visible_and_uniq_scopes_in_case_anonymous_group_has_memberships |
|
996 |
project = projects(:projects_001) |
|
997 |
user = Group.find(13) |
|
998 |
member = Member.create!(:project => project, :principal => user, :roles => [Role.generate!]) |
|
999 |
project.members << member |
|
1000 |
Project.uniq.visible |
|
1001 |
end |
|
994 | 1002 |
end |