-
RuhmUndAnsehen authored
The current implementation of _to_partial_path composes the part of two bits, `collection' and `element'. ActiveModel::Name also contains these fields, and they are derived the same way _to_partial_path does it. However, _to_partial_path doesn't use the information in model_name, and solely relies on its own computations instead. This works for all standard cases, but not necessarily for models that provide a non-standard model_name. This commit fixes that and has _to_partial_path use model_name if the class responds to it.
RuhmUndAnsehen authoredThe current implementation of _to_partial_path composes the part of two bits, `collection' and `element'. ActiveModel::Name also contains these fields, and they are derived the same way _to_partial_path does it. However, _to_partial_path doesn't use the information in model_name, and solely relies on its own computations instead. This works for all standard cases, but not necessarily for models that provide a non-standard model_name. This commit fixes that and has _to_partial_path use model_name if the class responds to it.
Loading