Last active
August 29, 2015 14:11
-
-
Save px-amaac/440db488ef03964072e9 to your computer and use it in GitHub Desktop.
here
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
I am getting all photos through the tags table where tags has a search key and search value. I order them. | |
Is there a way to only get uniques? Right now if i have 2 tags with the same name it will return the same photo twice. | |
@photos = Photo.joins(:tags).where(tags: { key: params[:searchkey], value: params[:searchvalue] }).order("created_at DESC") | |
@photos = Photo.joins(:tags).where(:tags => { :key => params[:search_key], :value => params[:search_value] }).order("created_at DESC") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment