Skip to content

Commit

Permalink
Merge pull request #5335 from bgeuken/fix_issue_5133
Browse files Browse the repository at this point in the history
[frontend] Fix deprecation warnings for raw sql
  • Loading branch information
bgeuken committed Jul 10, 2018
2 parents 7303e03 + 1a20922 commit da0f8f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/api/app/mixins/has_relationships.rb
Expand Up @@ -77,8 +77,8 @@ def add_role(what, role)
end

def maintainers
direct_users = relationships.with_users_and_roles_query.maintainers.pluck('users.login as login').map { |user| User.find_by_login!(user) }
users_in_groups = relationships.with_groups_and_roles_query.maintainers.pluck('groups.title as title'). \
direct_users = relationships.with_users_and_roles_query.maintainers.pluck('users.login').map { |user| User.find_by_login!(user) }
users_in_groups = relationships.with_groups_and_roles_query.maintainers.pluck('groups.title'). \
map { |title| Group.find_by_title!(title).users }.flatten
(direct_users + users_in_groups).uniq
end
Expand Down
4 changes: 2 additions & 2 deletions src/api/app/models/relationship.rb
Expand Up @@ -148,11 +148,11 @@ def self.discard_cache
end

def self.with_users_and_roles
with_users_and_roles_query.pluck('users.login as login, roles.title AS role_name')
with_users_and_roles_query.pluck(:login, :title)
end

def self.with_groups_and_roles
with_groups_and_roles_query.pluck('groups.title as title', 'roles.title as role_name')
with_groups_and_roles_query.pluck('groups.title', 'roles.title')
end

private
Expand Down

0 comments on commit da0f8f3

Please sign in to comment.