Skip to content

Instantly share code, notes, and snippets.

@ewalk153
Last active August 29, 2015 14:09
Show Gist options
  • Select an option

  • Save ewalk153/a5290069b4443426a011 to your computer and use it in GitHub Desktop.

Select an option

Save ewalk153/a5290069b4443426a011 to your computer and use it in GitHub Desktop.
All queries should be empty! :). This can be run on a rails 3.2.x codebase to make sure ActiveRecords is prepared for rails 4. This does NOT handle rails4 methods that have no rails 3.2 counterpart.
# no find_all_by
grep -e "find_all_by" -r --include "*.rb" .
# no :conditions
grep -e ":conditions" -r --include "*.rb" .
# no naked scopes
grep -r -e "scope :" --include "*.rb" . | grep -v "lambda" | grep -v '\->'
# no naked default_scopes
grep -r -e "default_scope" --include "**/models/*.rb" . | grep -v "lambda" | grep -v '\->'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment