Created
December 30, 2011 09:51
-
-
Save prikha/1539059 to your computer and use it in GitHub Desktop.
Annotate rails models on db:migrate
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
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 after | 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