`get_loaded_model_by_path` is supposed to be nil-safe (#883)
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.
Showing
Please
register
or
sign in
to comment