Skip to content

Support filter aliases#25

Closed
botandrose wants to merge 1 commit intomakandra:mainfrom
botandrose:support-filter-aliases
Closed

Support filter aliases#25
botandrose wants to merge 1 commit intomakandra:mainfrom
botandrose:support-filter-aliases

Conversation

@botandrose
Copy link
Copy Markdown

Hi folks, we've been using minidusen in production at https://bardtracker.com for a while now, and so far its been a great fit for our search functionality. I'm opening this PR to inquire if there's an appetite to upstream the following filter alias functionality that we use extensively:

filter :owner, :owner_id, :owned_by do |scope, string|
  ...
end

This is equivalent to duplicating the block three times, once for each field.

What do you think? If you're open to merging something like this, I'll make another pass to add tests and documentation. If not, cheers, and we'll just keep it as a monkey-patch.

@triskweline
Copy link
Copy Markdown
Member

Will merge this with tests and docs! Docs are just the README.

@botandrose botandrose force-pushed the support-filter-aliases branch from 2596b67 to bd73708 Compare July 19, 2025 09:55
@botandrose botandrose changed the title [WIP] Support filter aliases Support filter aliases Jul 19, 2025
@botandrose
Copy link
Copy Markdown
Author

@triskweline Okay, finally got around to finishing this up! Ready for review.

FLeinzi added a commit that referenced this pull request Aug 20, 2025
@FLeinzi FLeinzi mentioned this pull request Aug 20, 2025
@FLeinzi
Copy link
Copy Markdown
Contributor

FLeinzi commented Aug 20, 2025

@botandrose Somehow I could not checkout your branch. Changes look good to me, thanks.

I committed them myself in #28 to run CI and prepare the merge.

That's a nice solution with the alias. In one of my projects I did this to achieve it:

my_filter = lambda { |scope, string| ... }

filter :owner, &my_filter
filter :owner_id, &my_filter
filter :owned_by, &my_filter

But your solution is smarter than that.

FLeinzi added a commit that referenced this pull request Aug 20, 2025
@FLeinzi
Copy link
Copy Markdown
Contributor

FLeinzi commented Aug 20, 2025

Released as 1.0.1

@FLeinzi FLeinzi closed this Aug 20, 2025
@botandrose botandrose deleted the support-filter-aliases branch August 23, 2025 12:05
@botandrose
Copy link
Copy Markdown
Author

...and https://bardtracker.com is back on mainline minidusen! Thanks very much.

@FLeinzi
Copy link
Copy Markdown
Contributor

FLeinzi commented Aug 25, 2025

You're welcome!

@triskweline
Copy link
Copy Markdown
Member

...and https://bardtracker.com/ is back on mainline minidusen!

TIL about BARD Tracker :) A year ago we migrated about a 100 Pivotal Tracker projects to Linear.

@botandrose
Copy link
Copy Markdown
Author

@triskweline ha, yeah we did the exact same thing, and we missed Pivotal so much that we just decided to build our own clone. Opening it up to the public was a later decision.

If you're feeling nostalgic, we support Pivotal .zip imports, and we're free for single users! $5/mo/collaborator after that.

In any event, it was really nice not to have to implement search from scratch, so big thank you there 🙏

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.

4 participants