Skip to content

Commit

Permalink
Merge pull request ctran#259 from ctran/revert-249-run-on-rollback
Browse files Browse the repository at this point in the history
Revert "Runs annotate on 'rake db:rollback' too"
  • Loading branch information
ctran committed Jun 16, 2015
2 parents 1ee47e5 + 8f3aeb1 commit d878a5b
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions lib/tasks/migrate.rake
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,20 @@
# (They are not used to build annotate itself.)

# Append annotations to Rake tasks for ActiveRecord, so annotate automatically gets
# run after doing db:migrate.
# run after doing db:migrate.
# Unfortunately it relies on ENV for options; it'd be nice to be able to set options
# in a per-project config file so this task can read them.
namespace :db do
[:migrate, :rollback].each do |cmd|
task cmd do
Annotate::Migration.update_annotations
end
task :migrate do
Annotate::Migration.update_annotations
end

namespace cmd do
[:change, :up, :down, :reset, :redo].each do |t|
task t do
Annotate::Migration.update_annotations
end
namespace :migrate do
[:change, :up, :down, :reset, :redo].each do |t|
task t do
Annotate::Migration.update_annotations
end
end
end
end
end

Expand All @@ -28,7 +26,7 @@ module Annotate
def self.update_annotations
unless @@working || (ENV['skip_on_db_migrate'] =~ /(true|t|yes|y|1)$/i)
@@working = true
Rake::Task['annotate_models'].invoke
Rake::Task['annotate_models'].invoke
end
end
end
Expand Down

0 comments on commit d878a5b

Please sign in to comment.