Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
annotate
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
annotate
Commits
7b330655
Commit
7b330655
authored
May 22, 2015
by
Andrew Goodnough
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Runs annotate on 'rake db:rollback' too
parent
0146ee7b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
migrate.rake
lib/tasks/migrate.rake
+12
-10
No files found.
lib/tasks/migrate.rake
View file @
7b330655
...
@@ -2,20 +2,22 @@
...
@@ -2,20 +2,22 @@
# (They are not used to build annotate itself.)
# (They are not used to build annotate itself.)
# Append annotations to Rake tasks for ActiveRecord, so annotate automatically gets
# 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
# 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.
# in a per-project config file so this task can read them.
namespace
:db
do
namespace
:db
do
task
:migrate
do
[
:migrate
,
:rollback
].
each
do
|
cmd
|
Annotate
::
Migration
.
update_annotations
task
cmd
do
end
Annotate
::
Migration
.
update_annotations
end
namespace
:migrate
do
namespace
cmd
do
[
:change
,
:up
,
:down
,
:reset
,
:redo
].
each
do
|
t
|
[
:change
,
:up
,
:down
,
:reset
,
:redo
].
each
do
|
t
|
task
t
do
task
t
do
Annotate
::
Migration
.
update_annotations
Annotate
::
Migration
.
update_annotations
end
end
end
end
end
end
end
end
end
...
@@ -26,7 +28,7 @@ module Annotate
...
@@ -26,7 +28,7 @@ module Annotate
def
self
.
update_annotations
def
self
.
update_annotations
unless
@@working
||
(
ENV
[
'skip_on_db_migrate'
]
=~
/(true|t|yes|y|1)$/i
)
unless
@@working
||
(
ENV
[
'skip_on_db_migrate'
]
=~
/(true|t|yes|y|1)$/i
)
@@working
=
true
@@working
=
true
Rake
::
Task
[
'annotate_models'
].
invoke
Rake
::
Task
[
'annotate_models'
].
invoke
end
end
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment