Open Rubytastic2 opened 8 years ago
What would be the correct syntax for something like:
@employees = Employee.with_career_level(1)
.with_degree([1,2])
Passing multiple values somehow?
Also this fails ( logical)
@employees = Employee.with_career_level(1)
.with_degree(1)
.with_degree(2)
Nobody knows? Passing single var works fine but no way to add multiple values ?
An rails array would have been logic but this fails.
Would i need name Matching? In Passing mosty arrays of ids bit some text also Seems the onmy reference in the docs on how to search against multiple values? Would this support ids also in array like 1,3,4,5,8 ?
class Animal < ActiveRecord::Base include PgSearch pg_search_scope :with_name_matching, :against => :name, :using => { :tsearch => {:negation => true} } end
one_fish = Animal.create(:name => "one fish") two_fish = Animal.create(:name => "two fish") red_fish = Animal.create(:name => "red fish") blue_fish = Animal.create(:name => "blue fish")
Animal.with_name_matching("fish !red !blue") # => [one_fish, t
Is there also a with_id_matching?
What would be the best way to approach a search with multiple associated tables and multiple values?
This works flawless, but I need to pass multiple params towards .with_career_level and .with_degree Is there a way to pass multiple values?