Skip to content

Instantly share code, notes, and snippets.

View christopherdro's full-sized avatar

Chris Dro christopherdro

View GitHub Profile
def find_restaurants
restaurants = Restaurant.order(:name)
restaurants = restaurants.where("name like ?", "%#{keywords}%") if keywords.present?
restaurants = restaurants.tagged_with("#{cuisine_id}") if cuisine_id.present?
restaurants = restaurants.tagged_with("241") if offer_241.blank?
restaurants = restaurants.tagged_with("50") if offer_50.blank?
restaurants
end