Skip to content

Instantly share code, notes, and snippets.

@stefanahman
Last active March 8, 2019 15:07
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 stefanahman/e223264548c482c1388ed4e7f6ec8b53 to your computer and use it in GitHub Desktop.
Save stefanahman/e223264548c482c1388ed4e7f6ec8b53 to your computer and use it in GitHub Desktop.

find_by(*) => where(*).first

Search:

find_by\((.*?)\)$
find_by\((.*?)\)

Replace:

where($1).first

find_by!(*) => where(*).first!

Search:

find_by!\((.*?)\)$
find_by!\((.*?)\)

Replace:

where($1).first!

find_by * => where(*).first

Search:

find_by\s(.*)

Replace:

where($1).first
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment