diff options
author | Jasper Maes <jaspermaes.jm@gmail.com> | 2018-11-17 18:14:36 +0300 |
---|---|---|
committer | Jasper Maes <jaspermaes.jm@gmail.com> | 2018-11-17 18:14:36 +0300 |
commit | 5d5481519deb304243ed1c09171ccf8a45052d46 (patch) | |
tree | 88230bf396d2cfa9afdda5b22ed0eacb497d2392 /app/services/todos | |
parent | 29d8179ba07be3ed111f939285eb4064d84cb7df (diff) |
Rails5: Passing a class as a value in an Active Record query is deprecated
Diffstat (limited to 'app/services/todos')
-rw-r--r-- | app/services/todos/destroy/entity_leave_service.rb | 2 | ||||
-rw-r--r-- | app/services/todos/destroy/private_features_service.rb | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/app/services/todos/destroy/entity_leave_service.rb b/app/services/todos/destroy/entity_leave_service.rb index e8d1bcdd142..ebfb20132d0 100644 --- a/app/services/todos/destroy/entity_leave_service.rb +++ b/app/services/todos/destroy/entity_leave_service.rb @@ -45,7 +45,7 @@ module Todos # rubocop: disable CodeReuse/ActiveRecord def remove_confidential_issue_todos Todo.where( - target_id: confidential_issues.select(:id), target_type: Issue, user_id: user.id + target_id: confidential_issues.select(:id), target_type: Issue.name, user_id: user.id ).delete_all end # rubocop: enable CodeReuse/ActiveRecord diff --git a/app/services/todos/destroy/private_features_service.rb b/app/services/todos/destroy/private_features_service.rb index a8c3fe0ef5a..bd49519d694 100644 --- a/app/services/todos/destroy/private_features_service.rb +++ b/app/services/todos/destroy/private_features_service.rb @@ -14,9 +14,9 @@ module Todos def execute ProjectFeature.where(project_id: project_ids).each do |project_features| target_types = [] - target_types << Issue if private?(project_features.issues_access_level) - target_types << MergeRequest if private?(project_features.merge_requests_access_level) - target_types << Commit if private?(project_features.repository_access_level) + target_types << Issue.name if private?(project_features.issues_access_level) + target_types << MergeRequest.name if private?(project_features.merge_requests_access_level) + target_types << Commit.name if private?(project_features.repository_access_level) next if target_types.empty? |