Class: Administrate::Search
- Inherits:
-
Object
- Object
- Administrate::Search
- Defined in:
- lib/administrate/search.rb
Defined Under Namespace
Classes: Query
Instance Method Summary collapse
-
#initialize(scoped_resource, dashboard, term) ⇒ Search
constructor
A new instance of Search.
- #run ⇒ Object
Constructor Details
#initialize(scoped_resource, dashboard, term) ⇒ Search
Returns a new instance of Search.
51 52 53 54 55 |
# File 'lib/administrate/search.rb', line 51 def initialize(scoped_resource, dashboard, term) @dashboard = dashboard @scoped_resource = scoped_resource @query = Query.new(term, valid_filters.keys) end |
Instance Method Details
#run ⇒ Object
57 58 59 60 61 62 63 64 |
# File 'lib/administrate/search.rb', line 57 def run if query.blank? @scoped_resource.all else results = search_results(@scoped_resource) filter_results(results) end end |