ctran/annotate_models — pull request #82 by adie (2012-06-09 15:00:38+00:00)
Title: Additional checks

***

First check is to support models with no primary key

***

Also I changed `c.is_a?(Class)` to `Class === c` because of the following error:

```
Unable to annotate my_model.rb: wrong number of arguments(2 for 1)
(.../activesupport-3.2.5/lib/active_support/option_merger.rb:22:in `is_a?')
```

I didn't find the reason of that error, just tried `Class === c` and it worked.

***

And I had to add the last check because of some strange errors from factory_girl:

```
Unable to annotate my_model.rb: undefined method `include?' for
#
(.../lib/annotate/annotate_models.rb:322:in `block in get_loaded_model')
```

I've found that it was trying to get ancestors for instance of [FactoryGirl::DefinitionProxy](https://github.com/thoughtbot/factory_girl/blob/master/lib/factory_girl/definition_proxy.rb), which seems to be making a lot of magic.

***