Class: Organizations::OrganizationAssociationCounter

Inherits:
Object
  • Object
show all
Includes:
ActionView::Helpers::NumberHelper, NumbersHelper
Defined in:
app/finders/organizations/organization_association_counter.rb

Constant Summary collapse

COUNTER_LIMIT =
1000

Constants included from NumbersHelper

NumbersHelper::WORDS

Instance Method Summary collapse

Methods included from NumbersHelper

#limited_counter_with_delimiter, #number_in_words

Constructor Details

#initialize(organization:, current_user:) ⇒ OrganizationAssociationCounter

Returns a new instance of OrganizationAssociationCounter.

Parameters:



12
13
14
15
# File 'app/finders/organizations/organization_association_counter.rb', line 12

def initialize(organization:, current_user:)
  @organization = organization
  @current_user = current_user
end

Instance Method Details

#executeObject



17
18
19
20
21
# File 'app/finders/organizations/organization_association_counter.rb', line 17

def execute
  return {} if organization.nil? || !authorized?

  association_counts
end