Welcome to mirror list, hosted at ThFree Co, Russian Federation.

issue_resource_event.rb « concerns « models « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1c24032dbbbd93e208809f7540cd15eccdd13cea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# frozen_string_literal: true

module IssueResourceEvent
  extend ActiveSupport::Concern

  included do
    belongs_to :issue

    scope :by_issue, ->(issue) { where(issue_id: issue.id) }

    scope :by_issue_ids_and_created_at_earlier_or_equal_to, ->(issue_ids, time) { where(issue_id: issue_ids).where('created_at <= ?', time) }
  end
end