Skip to content

Commit

Permalink
Merge pull request #5831 from bgeuken/remove_scope
Browse files Browse the repository at this point in the history
Drop with_packages scope from Relationship model
  • Loading branch information
bgeuken committed Sep 11, 2018
2 parents 5dc3b0b + 14106c2 commit dbaa3bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/api/app/controllers/status_project_controller.rb
Expand Up @@ -43,8 +43,8 @@ def package_hash(packages)
@package_hash
end

def relationships_for_package(keys)
Relationship.with_packages(keys).pluck(:package_id, :user_id, :group_id, :role_id)
def relationships_for_package(package_ids)
Relationship.where(package: package_ids).pluck(:package_id, :user_id, :group_id, :role_id)
end

def add_person(user_id, role_id, package_id)
Expand Down
1 change: 0 additions & 1 deletion src/api/app/models/relationship.rb
Expand Up @@ -52,7 +52,6 @@ class SaveError < APIError; end
scope :maintainers, lambda {
where(role_id: Role.hashed['maintainer'])
}
scope :with_packages, ->(packages) { where(package_id: packages) }

# we only care for project<->user relationships, but the cache is not *that* expensive
# to recalculate
Expand Down

0 comments on commit dbaa3bd

Please sign in to comment.