Class: Avo::SidebarProfileComponent
Constant Summary
Concerns::FindAssociationField::ASSOCIATIONS
Instance Method Summary
collapse
#has_with_trial
#find_association_field
Instance Method Details
#avatar ⇒ Object
6
7
8
9
10
11
12
|
# File 'app/components/avo/sidebar_profile_component.rb', line 6
def avatar
if @user.respond_to?(:avatar) && @user.avatar.present?
@user.avatar
else
""
end
end
|
#can_destroy_user? ⇒ Boolean
38
39
40
|
# File 'app/components/avo/sidebar_profile_component.rb', line 38
def can_destroy_user?
helpers.main_app.respond_to?(destroy_user_session_path)
end
|
#destroy_user_session_path ⇒ Object
32
33
34
35
36
|
# File 'app/components/avo/sidebar_profile_component.rb', line 32
def destroy_user_session_path
(Avo.configuration.sign_out_path_name || "destroy_#{Avo.configuration.current_user_resource_name}_session_path").to_sym
end
|
#name ⇒ Object
14
15
16
17
18
19
20
21
22
|
# File 'app/components/avo/sidebar_profile_component.rb', line 14
def name
if @user.respond_to?(:name) && @user.name.present?
@user.name
elsif @user.respond_to?(:email) && @user.email.present?
@user.email
else
"Avo user"
end
end
|
#title ⇒ Object
24
25
26
27
28
29
30
|
# File 'app/components/avo/sidebar_profile_component.rb', line 24
def title
if @user.respond_to?(:avo_title) && @user.avo_title.present?
@user.avo_title
else
""
end
end
|