ctran/annotate_models — pull request #111 by roman-zaharenkov (2013-01-09 12:56:31+00:00)
Title: Fix #110 (incorrect behaviour for spec annotating).

I have 4 files to annotate:

app/models/job_type.rb
app/models/work_order/job_type.rb
spec/models/job_type_spec.rb
spec/models/work_order/job_type_spec.rb

As result I have spec/models/work_order/job_type_spec.rb annotated with 'job_types' table but not 'work_order_job_types' as expected.

The problem is in find_test_file. It annotate model in the following order:

app/models/work_order/job_type.rb
app/models/job_type.rb

So when you run annotate it annotates spec/models/work_order/job_type_spec.rb with correct and then overrides it with incorrect header.