Class: Renalware::System::UsersAwaitingApprovalComponent
- Inherits:
-
ApplicationComponent
- Object
- ViewComponent::Base
- ApplicationComponent
- Renalware::System::UsersAwaitingApprovalComponent
- Defined in:
- app/components/renalware/system/users_awaiting_approval_component.rb
Instance Attribute Summary collapse
-
#current_user ⇒ Object
readonly
Returns the value of attribute current_user.
Instance Method Summary collapse
-
#initialize(current_user:) ⇒ UsersAwaitingApprovalComponent
constructor
A new instance of UsersAwaitingApprovalComponent.
- #users_needing_approval_count ⇒ Object
- #users_needing_approval_title ⇒ Object
Methods inherited from ApplicationComponent
Constructor Details
#initialize(current_user:) ⇒ UsersAwaitingApprovalComponent
Returns a new instance of UsersAwaitingApprovalComponent.
8 9 10 |
# File 'app/components/renalware/system/users_awaiting_approval_component.rb', line 8 def initialize(current_user:) @current_user = current_user end |
Instance Attribute Details
#current_user ⇒ Object (readonly)
Returns the value of attribute current_user.
6 7 8 |
# File 'app/components/renalware/system/users_awaiting_approval_component.rb', line 6 def current_user @current_user end |
Instance Method Details
#users_needing_approval_count ⇒ Object
12 13 14 |
# File 'app/components/renalware/system/users_awaiting_approval_component.rb', line 12 def users_needing_approval_count @users_needing_approval_count ||= User.unapproved.count end |
#users_needing_approval_title ⇒ Object
16 17 18 19 20 21 22 |
# File 'app/components/renalware/system/users_awaiting_approval_component.rb', line 16 def users_needing_approval_title [ users_needing_approval_count, "user".pluralize(users_needing_approval_count), "awaiting approval" ].join(" ") end |