Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: Extract Search::Query object #936

Closed
wants to merge 4 commits into from
Closed

Refactor: Extract Search::Query object #936

wants to merge 4 commits into from

Conversation

koppen
Copy link
Contributor

@koppen koppen commented Jul 15, 2017

This is a step towards making it easier to integrate the solution built by @nando in #276.

Adding collection scopes/filters means we need to add more involved search query parsing; this pull request gives us a place for that, instead of cluttering the Administrate::Search class with string-parsing capabilities.

This pull request changes no public behaviours.

koppen added 4 commits July 15, 2017 12:59
Fixes failures like:

    $ rspec ./spec/lib/administrate/search_spec.rb
    ...
    Failures:

      1) Administrate::Search#run searches using lower() + LIKE for all searchable fields
         Failure/Error: class User < ActiveRecord::Base; end

         NameError:
           uninitialized constant ActiveRecord
         # ./spec/lib/administrate/search_spec.rb:50:in `block (3 levels) in <top (required)>'
Adding collection scopes/filters means we need to add more involved search query
parsing; this gives us a place for that.
This brings method names closer in line with the terms used in the
[ActiveRecord::QueryMethods#where documentation](http://api.rubyonrails.org/classes/ActiveRecord/QueryMethods.html#method-i-where),
and it makes room for us to use `search_terms` and `query` for some more
Administrate-specific methods.
@koppen
Copy link
Contributor Author

koppen commented Jul 22, 2017

The changes here are included in #947, which is the pull request they were made for. Closing this one.

@koppen koppen closed this Jul 22, 2017
@koppen koppen deleted the extract_search_query branch July 22, 2017 20:01
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.

1 participant