Skip to content

Instantly share code, notes, and snippets.

@awd
Created November 4, 2011 20:01
Show Gist options
  • Save awd/1340334 to your computer and use it in GitHub Desktop.
Save awd/1340334 to your computer and use it in GitHub Desktop.
def search_cache
@search_cache ||= Sunspot.search [Course, Channel, Episode] do
keywords(query)
any_of do
with(:channel_id, accessible_channel_ids)
with(:course_id, accessible_course_ids)
with(:episode_id, accessible_episode_ids)
end
paginate(:page => current_page)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment