Commit 634783feb0131794eb1ed797a8c70e1674f9ba9e
1 parent
1e3d2389
Exists in
master
and in
4 other branches
Rename scope "in_group" to "in_namespace"
Showing
2 changed files
with
2 additions
and
2 deletions
Show diff stats
app/models/project.rb
... | ... | @@ -82,7 +82,7 @@ class Project < ActiveRecord::Base |
82 | 82 | scope :public_only, where(private_flag: false) |
83 | 83 | scope :without_user, ->(user) { where("id NOT IN (:ids)", ids: user.projects.map(&:id) ) } |
84 | 84 | scope :not_in_group, ->(group) { where("id NOT IN (:ids)", ids: group.project_ids ) } |
85 | - scope :in_group, ->(group) { where(namespace_id: group.id) } | |
85 | + scope :in_namespace, ->(namespace) { where(namespace_id: namespace.id) } | |
86 | 86 | scope :sorted_by_activity, ->() { order("(SELECT max(events.created_at) FROM events WHERE events.project_id = projects.id) DESC") } |
87 | 87 | scope :personal, ->(user) { where(namespace_id: user.namespace_id) } |
88 | 88 | scope :joined, ->(user) { where("namespace_id != ?", user.namespace_id) } | ... | ... |
app/views/admin/groups/show.html.haml
... | ... | @@ -76,7 +76,7 @@ |
76 | 76 | %tr{class: "user_#{u.id}"} |
77 | 77 | %td.name= link_to u.name, admin_user_path(u) |
78 | 78 | %td.projects_access |
79 | - - u.projects.in_group(@group).each do |project| | |
79 | + - u.projects.in_namespace(@group).each do |project| | |
80 | 80 | - u_p = u.users_projects.in_project(project).first |
81 | 81 | = "#{project.name} (#{link_to u_p.project_access_human, edit_admin_team_member_path(u_p) })".html_safe |
82 | 82 | %tr | ... | ... |