Skip to content

Instantly share code, notes, and snippets.

Created November 27, 2015 23:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/280967590632f95d6341 to your computer and use it in GitHub Desktop.
Save anonymous/280967590632f95d6341 to your computer and use it in GitHub Desktop.
def reviews
@reviews ||= begin
_reviews = Review.published
if params[:book_slug].present?
_reviews = _reviews.where(book_slug: params[:book_slug])
end
_reviews
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment