Skip to content

Commit

Permalink
Merge pull request #99 from vlado/fix_position_option
Browse files Browse the repository at this point in the history
Fix position option
  • Loading branch information
turadg committed Nov 12, 2012
2 parents 4a96f3a + 562970b commit be4e268
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -17,3 +17,4 @@
/spec/integration/*/tmp/*
!/spec/integration/*/tmp/.gitkeep
/spec/integration/*/db/test.*
.rbenv-version
8 changes: 4 additions & 4 deletions lib/annotate/annotate_models.rb
Expand Up @@ -286,29 +286,29 @@ def annotate(klass, file, header, options={})
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

unless options[:exclude_tests]
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

Expand Down

0 comments on commit be4e268

Please sign in to comment.