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
c479e5af
Commit
c479e5af
authored
Jun 03, 2015
by
Cuong Tran
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #254 from Foap/fix/invoke-options-on-migrations
Invoke get options task before annotating migrations
parents
ce188d3e
938ed541
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 @
c479e5af
...
@@ -29,7 +29,7 @@ module Annotate
...
@@ -29,7 +29,7 @@ module Annotate
:timestamp
,
:exclude_serializers
,
:classified_sort
,
:show_foreign_keys
,
:timestamp
,
:exclude_serializers
,
:classified_sort
,
:show_foreign_keys
,
]
]
OTHER_OPTIONS
=
[
OTHER_OPTIONS
=
[
:ignore_columns
:ignore_columns
,
:skip_on_db_migrate
]
]
PATH_OPTIONS
=
[
PATH_OPTIONS
=
[
:require
,
:model_dir
:require
,
:model_dir
...
...
lib/tasks/migrate.rake
View file @
c479e5af
...
@@ -2,20 +2,21 @@
...
@@ -2,20 +2,21 @@
# (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
# in a per-project config file so this task can read them.
namespace
:db
do
namespace
:db
do
task
:migrate
do
task
:migrate
do
Rake
::
Task
[
'set_annotation_options'
].
invoke
Annotate
::
Migration
.
update_annotations
Annotate
::
Migration
.
update_annotations
end
end
namespace
:migrate
do
namespace
:migrate
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
Rake
::
Task
[
'set_annotation_options'
].
invoke
Annotate
::
Migration
.
update_annotations
end
end
end
end
end
end
end
end
...
@@ -24,9 +25,9 @@ module Annotate
...
@@ -24,9 +25,9 @@ module Annotate
@@working
=
false
@@working
=
false
def
self
.
update_annotations
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
@@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