Skip to content

Commit 8f3aeb1

Browse files
committed
Revert "Runs annotate on 'rake db:rollback' too"
1 parent 1ee47e5 commit 8f3aeb1

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

lib/tasks/migrate.rake

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,20 @@
22
# (They are not used to build annotate itself.)
33

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

14-
namespace cmd do
15-
[:change, :up, :down, :reset, :redo].each do |t|
16-
task t do
17-
Annotate::Migration.update_annotations
18-
end
13+
namespace :migrate do
14+
[:change, :up, :down, :reset, :redo].each do |t|
15+
task t do
16+
Annotate::Migration.update_annotations
1917
end
20-
end
18+
end
2119
end
2220
end
2321

@@ -28,7 +26,7 @@ module Annotate
2826
def self.update_annotations
2927
unless @@working || (ENV['skip_on_db_migrate'] =~ /(true|t|yes|y|1)$/i)
3028
@@working = true
31-
Rake::Task['annotate_models'].invoke
29+
Rake::Task['annotate_models'].invoke
3230
end
3331
end
3432
end

0 commit comments

Comments
 (0)