Skip to content

Commit

Permalink
add github handle filter
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienpoly committed Jan 29, 2025
1 parent 7c4b91d commit 1be12f1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/avo/filters/github_handle.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class Avo::Filters::GitHubHandle < Avo::Filters::TextFilter
self.name = "GitHub handle (contains)"

def apply(request, query, value)
query.where("github LIKE ?", "%#{value}%")
end
end
1 change: 1 addition & 0 deletions app/avo/resources/speaker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def filters
filter Avo::Filters::Name
filter Avo::Filters::Slug
filter Avo::Filters::GitHub
filter Avo::Filters::GitHubHandle
end

def actions
Expand Down

0 comments on commit 1be12f1

Please sign in to comment.