1# frozen_string_literal: true
2
3module IssueResourceEvent
4  extend ActiveSupport::Concern
5
6  included do
7    belongs_to :issue
8
9    scope :by_issue, ->(issue) { where(issue_id: issue.id) }
10
11    scope :by_issue_ids_and_created_at_earlier_or_equal_to, ->(issue_ids, time) { where(issue_id: issue_ids).where('created_at <= ?', time) }
12  end
13end
14