Skip to content

Fix event name search filter on admin activities page#1347

Open
maebeale wants to merge 1 commit intomainfrom
maebeale/fix-event-name-search
Open

Fix event name search filter on admin activities page#1347
maebeale wants to merge 1 commit intomainfrom
maebeale/fix-event-name-search

Conversation

@maebeale
Copy link
Collaborator

@maebeale maebeale commented Mar 5, 2026

What is the goal of this PR and why is this important?

  • The "Event Name" search field on /admin/activities/events was not filtering results at all
  • The view sent params[:name] but the controller never applied it as a filter

How did you approach the change?

  • Added a LIKE query filter in AhoyActivitiesController#index that does substring matching on ahoy_events.name
  • Used sanitize_sql_like to prevent SQL injection from wildcard characters
  • Added two request specs: exact name match and partial/substring match

UI Testing Checklist

  • Visit /admin/activities/events, type an event name (e.g. "auth.login"), click Filter — only matching events appear
  • Try a partial name (e.g. "bookmark") — only events containing that substring appear
  • Clear the field and filter — all events appear again

Anything else to add?

N/A

🤖 Generated with Claude Code

The view passed params[:name] from the Event Name text field but the
controller never used it to filter results.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant