Hey, I got a find condition that is a bit lengthy and I'd like make it lengthier.
SO far
:conditions => ["name LIKE ? OR description LIKE ?", "%#{params[:search_keyword]}%",
"%#{params[:search_keyword]}%"]
Where it's searching the model for if the attribute :name or :description is like a param from a text box. Now I'd also like to add to make sure the entries found are current. I already have
:conditions => ["start_date between ? and ? ", Date.today, @yearstime ]
Where @yearstime is @yearstime = Date.today + 365.days so essentially everything thing in the model from the present date to a year from now
I'd like to combine both conditions but am unsure of the syntax. I tried to put it all together.
:conditions => ["name LIKE ? OR description LIKE ? AND start_date between ? and ?",
"%#{params[:search_keyword]}%", "%#{params[:search_keyword]}%", Date.today, @yearstime ]
but it still isn't calculating for the date parameter....Any idea what I'm doing wrong?