Class: Decidim::ParticipatorySpaceLastActivity

Inherits:
Query
  • Object
show all
Defined in:
decidim-core/app/queries/decidim/participatory_space_last_activity.rb

Overview

This query finds the public ActionLog entries that can be shown in the activities views of the application within a Decidim participatory space.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Query

#cached_query, #each, #eager?, #exists?, merge, #none?, #relation?, #|

Constructor Details

#initialize(participatory_space) ⇒ ParticipatorySpaceLastActivity

Returns a new instance of ParticipatorySpaceLastActivity.



9
10
11
12
# File 'decidim-core/app/queries/decidim/participatory_space_last_activity.rb', line 9

def initialize(participatory_space)
  @participatory_space = participatory_space
  @organization = participatory_space&.organization
end

Instance Attribute Details

#organizationObject (readonly)

Returns the value of attribute organization.



7
8
9
# File 'decidim-core/app/queries/decidim/participatory_space_last_activity.rb', line 7

def organization
  @organization
end

#participatory_spaceObject (readonly)

Returns the value of attribute participatory_space.



7
8
9
# File 'decidim-core/app/queries/decidim/participatory_space_last_activity.rb', line 7

def participatory_space
  @participatory_space
end

Instance Method Details

#queryObject



14
15
16
# File 'decidim-core/app/queries/decidim/participatory_space_last_activity.rb', line 14

def query
  LastActivity.new(organization).query.where(participatory_space:)
end