Skip to content

Instantly share code, notes, and snippets.

@tanelsuurhans
Created February 26, 2013 20:47
Show Gist options
  • Save tanelsuurhans/5042018 to your computer and use it in GitHub Desktop.
Save tanelsuurhans/5042018 to your computer and use it in GitHub Desktop.
def self.stuff
scope = scoped
scope = scope.order("foo") if stuff
scope = scope.joins(:user) if user
scope = scope.where(:foo => "bar")
scope
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment