This commit partially reverts #801, which by declaring conditional return has turned `get_loaded_model_by_path` to a less safe method that can return nil when its the condition is not met. Apparently the very same condition has been brought to `annotate_model_file` by #774, which seems to cover the "bug" insisted in #801 as well. On the other hand #801 has brought an inconvenient behaviour as well: whenever a non-activerecord model file is found, `get_loaded_model_by_path` returns nil, which leads to raising `BadModelFileError` and ends up printing a bunch of "Unable to annotate ..." messages. Now it seems tests added by #801 are running right and I do not find a problem restoring the previous behaviour and turn it nil-safe again.
Name |
Last commit
|
Last update |
---|---|---|
.github | Loading commit data... | |
bin | Loading commit data... | |
lib | Loading commit data... | |
spec | Loading commit data... | |
.dockerignore | Loading commit data... | |
.document | Loading commit data... | |
.gitignore | Loading commit data... | |
.overcommit.yml | Loading commit data... | |
.rbenv-gemsets | Loading commit data... | |
.rspec | Loading commit data... | |
.rubocop.yml | Loading commit data... | |
.rubocop_todo.yml | Loading commit data... | |
.tool-versions | Loading commit data... | |
.travis.yml | Loading commit data... | |
.yardopts | Loading commit data... | |
AUTHORS.md | Loading commit data... | |
CHANGELOG.md | Loading commit data... | |
Gemfile | Loading commit data... | |
Guardfile | Loading commit data... | |
LICENSE.txt | Loading commit data... | |
README.md | Loading commit data... | |
RELEASE.md | Loading commit data... | |
Rakefile | Loading commit data... | |
annotate.gemspec | Loading commit data... | |
potato.md | Loading commit data... |