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
be4e2682
Commit
be4e2682
authored
Nov 12, 2012
by
Turadg Aleahmad
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #99 from vlado/fix_position_option
Fix position option
parents
4a96f3a1
562970b1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
.gitignore
.gitignore
+2
-0
annotate_models.rb
lib/annotate/annotate_models.rb
+4
-4
No files found.
.gitignore
View file @
be4e2682
...
...
@@ -17,3 +17,4 @@
/spec/integration/*/tmp/*
!/spec/integration/*/tmp/.gitkeep
/spec/integration/*/db/test.*
.rbenv-version
\ No newline at end of file
lib/annotate/annotate_models.rb
View file @
be4e2682
...
...
@@ -286,7 +286,7 @@ module AnnotateModels
table_name
=
klass
.
table_name
model_file_name
=
File
.
join
(
model_dir
,
file
)
if
annotate_one_file
(
model_file_name
,
info
,
options_with_position
(
options
,
:position_in_class
))
if
annotate_one_file
(
model_file_name
,
info
,
:position_in_class
,
options_with_position
(
options
,
:position_in_class
))
did_annotate
=
true
end
...
...
@@ -294,21 +294,21 @@ module AnnotateModels
did_annotate
=
TEST_PATTERNS
.
map
{
|
pat
|
[
pat
[
0
],
resolve_filename
(
pat
[
1
],
model_name
,
table_name
)]
}.
map
{
|
pat
|
find_test_file
(
*
pat
)
}.
map
{
|
file
|
annotate_one_file
(
file
,
info
,
options_with_position
(
options
,
:position_in_test
))
}.
map
{
|
file
|
annotate_one_file
(
file
,
info
,
:position_in_test
,
options_with_position
(
options
,
:position_in_test
))
}.
detect
{
|
result
|
result
}
||
did_annotate
end
unless
options
[
:exclude_fixtures
]
did_annotate
=
FIXTURE_PATTERNS
.
map
{
|
file
|
resolve_filename
(
file
,
model_name
,
table_name
)
}.
map
{
|
file
|
annotate_one_file
(
file
,
info
,
options_with_position
(
options
,
:position_in_fixture
))
}.
map
{
|
file
|
annotate_one_file
(
file
,
info
,
:position_in_fixture
,
options_with_position
(
options
,
:position_in_fixture
))
}.
detect
{
|
result
|
result
}
||
did_annotate
end
unless
options
[
:exclude_factories
]
did_annotate
=
FACTORY_PATTERNS
.
map
{
|
file
|
resolve_filename
(
file
,
model_name
,
table_name
)
}.
map
{
|
file
|
annotate_one_file
(
file
,
info
,
options_with_position
(
options
,
:position_in_factory
))
}.
map
{
|
file
|
annotate_one_file
(
file
,
info
,
:position_in_factory
,
options_with_position
(
options
,
:position_in_factory
))
}.
detect
{
|
result
|
result
}
||
did_annotate
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