Class: ResourceMilestoneEventFinder

Inherits:
Object
  • Object
show all
Defined in:
app/finders/resource_milestone_event_finder.rb

Instance Method Summary collapse

Constructor Details

#initialize(current_user, eventable) ⇒ ResourceMilestoneEventFinder

Returns a new instance of ResourceMilestoneEventFinder.


4
5
6
7
# File 'app/finders/resource_milestone_event_finder.rb', line 4

def initialize(current_user, eventable)
  @current_user = current_user
  @eventable = eventable
end

Instance Method Details

#executeObject

Returns the ResourceMilestoneEvents of the eventable visible to the user.

Returns:

  • ResourceMilestoneEvent::ActiveRecord_AssociationRelation


13
14
15
16
# File 'app/finders/resource_milestone_event_finder.rb', line 13

def execute
  eventable.resource_milestone_events.include_relations
    .where(milestone_id: readable_milestone_ids) # rubocop: disable CodeReuse/ActiveRecord
end