diff options
Diffstat (limited to 'app/models/todo.rb')
-rw-r--r-- | app/models/todo.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/models/todo.rb b/app/models/todo.rb index d159b51a0eb..e64dbf83a4c 100644 --- a/app/models/todo.rb +++ b/app/models/todo.rb @@ -6,7 +6,7 @@ class Todo < ApplicationRecord include EachBatch include IgnorableColumns - ignore_column :note_id_convert_to_bigint, remove_with: '16.2', remove_after: '2023-07-22' + ignore_column :note_id_convert_to_bigint, remove_with: '16.7', remove_after: '2023-11-16' # Time to wait for todos being removed when not visible for user anymore. # Prevents TODOs being removed by mistake, for example, removing access from a user @@ -25,6 +25,7 @@ class Todo < ApplicationRecord REVIEW_REQUESTED = 9 MEMBER_ACCESS_REQUESTED = 10 REVIEW_SUBMITTED = 11 # This is an EE-only feature + OKR_CHECKIN_REQUESTED = 12 # This is an EE-only feature ACTION_NAMES = { ASSIGNED => :assigned, @@ -37,7 +38,8 @@ class Todo < ApplicationRecord DIRECTLY_ADDRESSED => :directly_addressed, MERGE_TRAIN_REMOVED => :merge_train_removed, MEMBER_ACCESS_REQUESTED => :member_access_requested, - REVIEW_SUBMITTED => :review_submitted + REVIEW_SUBMITTED => :review_submitted, + OKR_CHECKIN_REQUESTED => :okr_checkin_requested }.freeze ACTIONS_MULTIPLE_ALLOWED = [Todo::MENTIONED, Todo::DIRECTLY_ADDRESSED, Todo::MEMBER_ACCESS_REQUESTED].freeze @@ -78,6 +80,7 @@ class Todo < ApplicationRecord scope :for_type, -> (type) { where(target_type: type) } scope :for_target, -> (id) { where(target_id: id) } scope :for_commit, -> (id) { where(commit_id: id) } + scope :not_in_users, -> (user_ids) { where.not('todos.user_id' => user_ids) } scope :with_entity_associations, -> do preload(:target, :author, :note, group: :route, project: [:route, :group, { namespace: [:route, :owner] }, :project_setting]) end |