-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract scoped search to separate presenter
Since out code for scoped searches is getting a bit more involved with the inclusion of un-scoped results, let's extract this functionality to a new presenter `scoped_search_results_presenter`. This commit just extracts the existing functionality into a new presenter, no new features are added.
- Loading branch information
Alice Bartlett
committed
Apr 9, 2015
1 parent
5b7049b
commit 804af74
Showing
3 changed files
with
39 additions
and
32 deletions.
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,19 @@ | ||
class ScopedSearchResultsPresenter < SearchResultsPresenter | ||
|
||
def to_hash | ||
super.merge({ | ||
is_scoped?: true, | ||
scope_title: scope_title, | ||
}) | ||
end | ||
|
||
private | ||
|
||
def filter_fields | ||
end | ||
|
||
def scope_title | ||
search_response[:scope][:title] | ||
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