Class: Decidim::DirectVerifications::UserStats

Inherits:
Object
  • Object
show all
Defined in:
lib/decidim/direct_verifications/user_stats.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(organization) ⇒ UserStats

Returns a new instance of UserStats.



6
7
8
9
10
# File 'lib/decidim/direct_verifications/user_stats.rb', line 6

def initialize(organization)
  @organization = organization
  @authorization_handler = ""
  @emails = []
end

Instance Attribute Details

#authorization_handlerObject

Returns the value of attribute authorization_handler.



12
13
14
# File 'lib/decidim/direct_verifications/user_stats.rb', line 12

def authorization_handler
  @authorization_handler
end

#emailsObject

Returns the value of attribute emails.



13
14
15
# File 'lib/decidim/direct_verifications/user_stats.rb', line 13

def emails
  @emails
end

#organizationObject (readonly)

Returns the value of attribute organization.



12
13
14
# File 'lib/decidim/direct_verifications/user_stats.rb', line 12

def organization
  @organization
end

Instance Method Details

#authorizedObject



28
29
30
# File 'lib/decidim/direct_verifications/user_stats.rb', line 28

def authorized
  authorized_users.count
end

#authorized_unconfirmedObject



32
33
34
# File 'lib/decidim/direct_verifications/user_stats.rb', line 32

def authorized_unconfirmed
  authorized_users.where(decidim_users: { confirmed_at: nil }).count
end

#registeredObject



20
21
22
# File 'lib/decidim/direct_verifications/user_stats.rb', line 20

def registered
  registered_users.count
end

#unconfirmedObject



24
25
26
# File 'lib/decidim/direct_verifications/user_stats.rb', line 24

def unconfirmed
  registered_users.where(decidim_users: { confirmed_at: nil }).count
end