refactor
fixed: modifying the relation to correspond to the request parameters in actions other than :index, which leads to unnecessary computation