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

Fix #45 Make scopes option can accepts Proc #48

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Feb 5, 2016

  1. Fix risuiowa#45 Make scopes option can accepts Proc

    Scopes can also override the select and where.
    So you can use code like following to query unique result.
    
        autocomplete :item, :brand, full: true, scopes: [-> { unscope(:select).select('MIN(id) as id, brand').group(:brand) }]
    lingceng committed Feb 5, 2016
    Configuration menu
    Copy the full SHA
    d563ed9 View commit details
    Browse the repository at this point in the history
  2. Add unique option

    Use unique option to remove dulidate result:
    
        autocomplete :item, :brand, full: true, unique: true
    lingceng committed Feb 5, 2016
    Configuration menu
    Copy the full SHA
    2a613e7 View commit details
    Browse the repository at this point in the history