Skip to content

Instantly share code, notes, and snippets.

@pmarreck
Created February 27, 2013 18:06
Show Gist options
  • Save pmarreck/5050061 to your computer and use it in GitHub Desktop.
Save pmarreck/5050061 to your computer and use it in GitHub Desktop.
A search/replace regex (this one works in Sublime) to help convert Rails ActiveRecord non-lambda scopes into lambda scopes
# Search for:
/,\s((?:where|order|select)\(.+\))/
# Replace with:
', lambda{ \1 }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment