From 4508c2078c633e224a2d615b0bb02fa7e9644ba1 Mon Sep 17 00:00:00 2001 From: moveson Date: Tue, 17 Dec 2024 11:02:45 -0700 Subject: [PATCH] Show callout in My Stuff if no Person is assigned to User --- app/presenters/my_stuff_presenter.rb | 4 ++++ app/views/my_stuff/index.html.erb | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/app/presenters/my_stuff_presenter.rb b/app/presenters/my_stuff_presenter.rb index e7238d9ba..702346303 100644 --- a/app/presenters/my_stuff_presenter.rb +++ b/app/presenters/my_stuff_presenter.rb @@ -39,6 +39,10 @@ def owned_organizations Organization.where(created_by: current_user.id).order(:name) end + def person_not_assigned? + Person.where(user_id: current_user.id).none? + end + def steward_organizations current_user.organizations.where.not(created_by: current_user.id).order(:name) end diff --git a/app/views/my_stuff/index.html.erb b/app/views/my_stuff/index.html.erb index 69702e694..451eede06 100644 --- a/app/views/my_stuff/index.html.erb +++ b/app/views/my_stuff/index.html.erb @@ -21,6 +21,20 @@ +<% if @presenter.person_not_assigned? %> + +<% end %> +