From b501f98d298bf565c6e7fc94a671623d3dd9b4f9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 15 Feb 2026 16:39:23 +0000 Subject: [PATCH 1/3] Initial plan From 29208684ad80fbe05690232085a192c1114e1280 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 15 Feb 2026 16:44:01 +0000 Subject: [PATCH 2/3] Add audit info partial to all edit pages Co-authored-by: maebeale <7607813+maebeale@users.noreply.github.com> --- app/helpers/application_helper.rb | 13 +++++++++++++ app/views/shared/_audit_info.html.erb | 8 ++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 4e9f8c3f5..15b70f869 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -169,4 +169,17 @@ def us_time_zone_fundamentals ] ActiveSupport::TimeZone.us_zones.select { |z| zone_names.include?(z.name) }.sort_by { |z| zone_names.index(z.name) }.map { |z| [ z.to_s, z.name ] } end + + # Generate URL to Ahoy events filtered to a specific resource + def ahoy_events_url_for(resource) + return unless resource&.persisted? + + # Build query parameters for filtering Ahoy events to this resource + # The Ahoy events controller uses properties->resource_type and properties->resource_id + # We'll filter by resource class name and ID + admin_activities_events_path( + resource_type: resource.class.name, + resource_id: resource.id + ) + end end diff --git a/app/views/shared/_audit_info.html.erb b/app/views/shared/_audit_info.html.erb index 91ce9d7b7..12eff4b7a 100644 --- a/app/views/shared/_audit_info.html.erb +++ b/app/views/shared/_audit_info.html.erb @@ -6,7 +6,7 @@ model = resource.respond_to?(:object) ? resource.object : resource created_by_user = resource.try(:created_by) || resource.try(:user) updated_by_user = resource.try(:updated_by) || resource.try(:user) - + # Check if there's a user association for models without explicit created_by resource_user = resource.try(:user) if created_by_user.nil? && updated_by_user.nil? %> @@ -24,14 +24,14 @@ <% end %> <% if allowed_to?(:index?, with: Admin::AhoyActivityPolicy) %> <%= link_to admin_activities_events_path(resource_type: model.class.name, resource_id: resource.id), - class: "ml-1 text-indigo-600 hover:underline", + class: "ml-1 text-indigo-600 hover:underline", title: "View creation event in Ahoy" do %> <% end %> <% end %> <% end %> - + <% if resource.updated_at.present? && resource.updated_at != resource.created_at %>
Last updated: @@ -43,7 +43,7 @@ <% end %> <% if allowed_to?(:index?, with: Admin::AhoyActivityPolicy) %> <%= link_to admin_activities_events_path(resource_type: model.class.name, resource_id: resource.id), - class: "ml-1 text-indigo-600 hover:underline", + class: "ml-1 text-indigo-600 hover:underline", title: "View update events in Ahoy" do %> <% end %> From f10669bc9cdbb62bba5132d1711db977ead150f2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 15 Feb 2026 16:46:27 +0000 Subject: [PATCH 3/3] Remove unused helper method and fix time format Co-authored-by: maebeale <7607813+maebeale@users.noreply.github.com> --- app/helpers/application_helper.rb | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 15b70f869..4e9f8c3f5 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -169,17 +169,4 @@ def us_time_zone_fundamentals ] ActiveSupport::TimeZone.us_zones.select { |z| zone_names.include?(z.name) }.sort_by { |z| zone_names.index(z.name) }.map { |z| [ z.to_s, z.name ] } end - - # Generate URL to Ahoy events filtered to a specific resource - def ahoy_events_url_for(resource) - return unless resource&.persisted? - - # Build query parameters for filtering Ahoy events to this resource - # The Ahoy events controller uses properties->resource_type and properties->resource_id - # We'll filter by resource class name and ID - admin_activities_events_path( - resource_type: resource.class.name, - resource_id: resource.id - ) - end end