forked from activeadmin/activeadmin-mongoid
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
59d8bf2
commit 0e262c9
Showing
4 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module ActiveAdmin | ||
module Filters | ||
module FormtasticAddons | ||
|
||
def searchable_has_many_through? | ||
false | ||
end | ||
|
||
def has_predicate? | ||
!!RansackMongo::Predicate.new(RansackMongo::MongoAdapter::PREDICATES).detect_from_string(method.to_s) | ||
end | ||
|
||
def ransacker? | ||
false | ||
end | ||
|
||
def scope? | ||
false | ||
end | ||
|
||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module ActiveAdmin | ||
class ResourceController < BaseController | ||
|
||
module DataAccess | ||
|
||
# Applies any Ransack search methods to the currently scoped collection. | ||
# Both `search` and `ransack` are provided, but we use `ransack` to prevent conflicts. | ||
def apply_filtering(chain) | ||
@search = chain.where RansackMongo::Query.parse clean_search_params params[:q] | ||
end | ||
end | ||
end | ||
end |