Browse Source

AR uniq deprecated in Rails 5.

git-svn-id: http://svn.redmine.org/redmine/trunk@16598 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/3.4.0
Jean-Philippe Lang 7 years ago
parent
commit
58dc4455cb
2 changed files with 2 additions and 2 deletions
  1. 1
    1
      app/controllers/workflows_controller.rb
  2. 1
    1
      app/models/user.rb

+ 1
- 1
app/controllers/workflows_controller.rb View File

@@ -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

+ 1
- 1
app/models/user.rb View File

@@ -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…
Cancel
Save