Skip to content
  • RuhmUndAnsehen's avatar
    3a3951a3
    Fix ActiveModel::Conversion._to_partial_path not using a model's model_name. · 3a3951a3
    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.
    3a3951a3
    Fix ActiveModel::Conversion._to_partial_path not using a model's model_name.
    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.
Loading