Created
September 7, 2011 16:08
-
-
Save joakimk/1200985 to your computer and use it in GitHub Desktop.
Script to automatically annotate models after db:migrate is run.
This file contains 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
# Used with: | |
# gem 'annotate', :git => 'git://github.com/ctran/annotate_models.git' | |
if Rails.env.development? | |
def after_task(task_name, &new_task) | |
old_task = Rake.application.instance_variable_get('@tasks').delete(task_name.to_s) | |
desc old_task.full_comment | |
task task_name do | |
old_task.invoke | |
new_task.call | |
end | |
end | |
after_task "db:migrate" do | |
system("bundle exec annotate -e tests,fixtures -p before | grep -v 'Nothing annotated.'") || exit(1) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I use guard-annotate to do the same thing.