mirror of
https://github.com/meineerde/redmine.git
synced 2026-01-02 13:49:42 +00:00
AR uniq deprecated in Rails 5.
git-svn-id: http://svn.redmine.org/redmine/trunk@16598 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
44c748f968
commit
58dc4455cb
@ -141,7 +141,7 @@ class WorkflowsController < ApplicationController
|
||||
role_ids = Role.all.select(&:consider_workflow?).map(&:id)
|
||||
status_ids = WorkflowTransition.where(
|
||||
:tracker_id => @trackers.map(&:id), :role_id => role_ids
|
||||
).uniq.pluck(:old_status_id, :new_status_id).flatten.uniq
|
||||
).distinct.pluck(:old_status_id, :new_status_id).flatten.uniq
|
||||
@statuses = IssueStatus.where(:id => status_ids).sorted.to_a.presence
|
||||
end
|
||||
@statuses ||= IssueStatus.sorted.to_a
|
||||
|
||||
@ -566,7 +566,7 @@ class User < Principal
|
||||
end
|
||||
|
||||
def roles
|
||||
@roles ||= Role.joins(members: :project).where(["#{Project.table_name}.status <> ?", Project::STATUS_ARCHIVED]).where(Member.arel_table[:user_id].eq(id)).uniq
|
||||
@roles ||= Role.joins(members: :project).where(["#{Project.table_name}.status <> ?", Project::STATUS_ARCHIVED]).where(Member.arel_table[:user_id].eq(id)).distinct
|
||||
end
|
||||
|
||||
# Returns the user's bult-in role
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user