Last active
November 11, 2015 19:07
-
-
Save ipoval/36de5aef564bb67b7243 to your computer and use it in GitHub Desktop.
rails find unused model
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
find app/models/ -name "*.rb" | xargs grep -h --color -e ^class | cut -d ' ' -f 2 | sort | uniq | while read k; do echo model class: "$k"; grep -r -l -w -m 1 --color "$k" ./app ./config ./lib ./script --exclude-dir=*assets* | head -n 2 | wc -l | grep 1; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment