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

Allow use of pluck instead of select #47

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

Commits on Feb 4, 2016

  1. allow use of pluck instead of select

    this in conjunction with using a scope that joins
    an association allows fetching attributes of associated
    records.
    
    class Organization
      belongs_to :contact
    
      scope :with_contact, -> { joins(:contact) }
    end
    
    autocomplete :organization, :name, extra_data: ['contacts.email'],
    select_method: :pluck, scopes: [:with_contact]
    
    f.autocomplete_field :name,
    autocomplete_organization_name_product_path, update_elements: {id:
    '#products_organization_attributes_id', 'contacts.email':
    '#products_contact_attributes_email'}
    lastobelus committed Feb 4, 2016
    Configuration menu
    Copy the full SHA
    37c5807 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7d72df3 View commit details
    Browse the repository at this point in the history
  3. ¯\_(ツ)_/¯

    lastobelus committed Feb 4, 2016
    Configuration menu
    Copy the full SHA
    8632ed8 View commit details
    Browse the repository at this point in the history

Commits on Feb 8, 2016

  1. when doing a pluck, we need to ensure no duplicate columns

    because rails internally does a uniq before querying
    lastobelus committed Feb 8, 2016
    Configuration menu
    Copy the full SHA
    3f052d0 View commit details
    Browse the repository at this point in the history