From 0a2ae443809246a2a342269edfc02f12270f21a9 Mon Sep 17 00:00:00 2001 From: Vlado Cingel Date: Tue, 2 Oct 2012 12:33:53 +0200 Subject: [PATCH 1/2] .rbenv-version added to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2b8dc7537..5f7d1feca 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ /spec/integration/*/tmp/* !/spec/integration/*/tmp/.gitkeep /spec/integration/*/db/test.* +.rbenv-version \ No newline at end of file From 562970b1b14aef88f0211b75620baa1721b0a6ca Mon Sep 17 00:00:00 2001 From: Vlado Cingel Date: Tue, 2 Oct 2012 12:38:35 +0200 Subject: [PATCH 2/2] fix arguments when calling annotate_one_file from AnnotateModels.annotate --- lib/annotate/annotate_models.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/annotate/annotate_models.rb b/lib/annotate/annotate_models.rb index 26173c96f..e90876bad 100644 --- a/lib/annotate/annotate_models.rb +++ b/lib/annotate/annotate_models.rb @@ -286,7 +286,7 @@ 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 @@ -294,21 +294,21 @@ def annotate(klass, file, header, options={}) 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