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
938ed541
Commit
938ed541
authored
Jun 03, 2015
by
arathunku
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Invoke get options task before annotating migrations
[ fixes #252 ]
parent
ce188d3e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
annotate.rb
lib/annotate.rb
+1
-1
migrate.rake
lib/tasks/migrate.rake
+8
-7
No files found.
lib/annotate.rb
View file @
938ed541
...
...
@@ -29,7 +29,7 @@ module Annotate
:timestamp
,
:exclude_serializers
,
:classified_sort
,
:show_foreign_keys
,
]
OTHER_OPTIONS
=
[
:ignore_columns
:ignore_columns
,
:skip_on_db_migrate
]
PATH_OPTIONS
=
[
:require
,
:model_dir
...
...
lib/tasks/migrate.rake
View file @
938ed541
...
...
@@ -2,20 +2,21 @@
# (They are not used to build annotate itself.)
# Append annotations to Rake tasks for ActiveRecord, so annotate automatically gets
# 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.
# run after doing db:migrate.
namespace
:db
do
task
:migrate
do
Rake
::
Task
[
'set_annotation_options'
].
invoke
Annotate
::
Migration
.
update_annotations
end
namespace
:migrate
do
[
:change
,
:up
,
:down
,
:reset
,
:redo
].
each
do
|
t
|
task
t
do
Annotate
::
Migration
.
update_annotations
Rake
::
Task
[
'set_annotation_options'
].
invoke
Annotate
::
Migration
.
update_annotations
end
end
end
end
end
...
...
@@ -24,9 +25,9 @@ module Annotate
@@working
=
false
def
self
.
update_annotations
unless
@@working
||
(
ENV
[
'skip_on_db_migrate'
]
=~
/(true|t|yes|y|1)$/i
)
unless
@@working
||
Annotate
.
skip_on_migration?
@@working
=
true
Rake
::
Task
[
'annotate_models'
].
invoke
Rake
::
Task
[
'annotate_models'
].
invoke
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