Skip to content

Commit be4e268

Browse files
committed
Merge pull request #99 from vlado/fix_position_option
Fix position option
2 parents 4a96f3a + 562970b commit be4e268

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@
1717
/spec/integration/*/tmp/*
1818
!/spec/integration/*/tmp/.gitkeep
1919
/spec/integration/*/db/test.*
20+
.rbenv-version

lib/annotate/annotate_models.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,29 +286,29 @@ def annotate(klass, file, header, options={})
286286
table_name = klass.table_name
287287
model_file_name = File.join(model_dir, file)
288288

289-
if annotate_one_file(model_file_name, info, options_with_position(options, :position_in_class))
289+
if annotate_one_file(model_file_name, info, :position_in_class, options_with_position(options, :position_in_class))
290290
did_annotate = true
291291
end
292292

293293
unless options[:exclude_tests]
294294
did_annotate = TEST_PATTERNS.
295295
map { |pat| [pat[0], resolve_filename(pat[1], model_name, table_name)] }.
296296
map { |pat| find_test_file(*pat) }.
297-
map { |file| annotate_one_file(file, info, options_with_position(options, :position_in_test)) }.
297+
map { |file| annotate_one_file(file, info, :position_in_test, options_with_position(options, :position_in_test)) }.
298298
detect { |result| result } || did_annotate
299299
end
300300

301301
unless options[:exclude_fixtures]
302302
did_annotate = FIXTURE_PATTERNS.
303303
map { |file| resolve_filename(file, model_name, table_name) }.
304-
map { |file| annotate_one_file(file, info, options_with_position(options, :position_in_fixture)) }.
304+
map { |file| annotate_one_file(file, info, :position_in_fixture, options_with_position(options, :position_in_fixture)) }.
305305
detect { |result| result } || did_annotate
306306
end
307307

308308
unless options[:exclude_factories]
309309
did_annotate = FACTORY_PATTERNS.
310310
map { |file| resolve_filename(file, model_name, table_name) }.
311-
map { |file| annotate_one_file(file, info, options_with_position(options, :position_in_factory)) }.
311+
map { |file| annotate_one_file(file, info, :position_in_factory, options_with_position(options, :position_in_factory)) }.
312312
detect { |result| result } || did_annotate
313313
end
314314

0 commit comments

Comments
 (0)