Skip to content

Instantly share code, notes, and snippets.

@mavenlink
mavenlink / finder_finder.sh
Created March 18, 2011 22:44
Find and count uses of find_by_xxx
#!/bin/sh
grep -R .find_by . | ruby -e 'STDIN.each do |l| puts "#{$1} #{$2}" if l =~ /([_\w]+)\.find_by_([_\w]+)/ && !%w[class self].include?($1) && !%w[solr sql id param].include?($2); end' | sort | uniq -c