Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Removed unused routing method

#3023

While working on #2510 url_for ignores routing priority I noticed this method that appears to be completely unused. I removed it and all tests are passing.

I've attached a patch.

It should apply to master and 2-3-stable

Reported by Gabe da Silveira · August 9th, 2009 @ 10:38 AM

State: resolved
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Rizwan Reza
    Rizwan Reza

    verified

    +1 This patch works perfectly on both current branches. But I am not sure if all of the tests pass, the method is useless, as there are methods present in the code which are not tested.

    August 9th, 2009 @ 03:43 PM

  2. Simon Jefford
    Simon Jefford

    -1 this method is in the public api for Routeset so could break plugins

    August 9th, 2009 @ 05:40 PM

  3. CancelProfileIsBroken
    CancelProfileIsBroken
    • State changed from new to wontfix

    No telling who might be using this. We may find out in 3.0 if it's not in the new public API :)

    August 9th, 2009 @ 05:49 PM

  4. CancelProfileIsBroken
    CancelProfileIsBroken
    • Tag changed from bugmash, routing to routing

    August 9th, 2009 @ 05:49 PM

  5. CancelProfileIsBroken
    CancelProfileIsBroken
    • Tag changed from routing to bugmash, routing

    Lifo suggests: remove from 2.3, add deprecation pointing to routes_for

    August 9th, 2009 @ 05:50 PM

  6. Dan Croak
    Dan Croak

    +1 verified Gabe's patch applies to 2-3-stable.

    I've attached a patch that deprecates instead of removes. Suggests route_for().

    August 9th, 2009 @ 05:56 PM

  7. Dan Croak
    Dan Croak
    • Assigned user set to Pratik

    August 9th, 2009 @ 05:56 PM

  8. Repository
  9. Repository
    Repository
    • State changed from wontfix to resolved

    (from [1185500ff0465aff8686315f1b785884f133adcf]) Remove unused routeset method routes_for_controller_and_action in favour for routes_for [#3023 Removed unused routing method state:resolved]

    Signed-off-by: Pratik Naik pratiknaik@gmail.com
    http://github.com/rails/rails/commit/1185500ff0465aff8686315f1b7858...

    August 9th, 2009 @ 06:19 PM

  10. Simon Jefford
    Simon Jefford
    • Assigned user cleared.

    Patch for 2.3 - deprecates the offending method. The patch above should be applied to master.

    August 9th, 2009 @ 06:20 PM

  11. Repository
  12. CancelProfileIsBroken
    CancelProfileIsBroken
    • Tag changed from bugmash, routing to routing

    August 9th, 2009 @ 06:53 PM

  13. tomtt
    tomtt

    I am not sure if this is the best place to ask this. If not, please tell where to go.

    This changeset generates a deprecation warning in the resources_controller plugin. The documentation of routes_for is non-existent so I was hoping somebody could point me in the right direction as to how to refactor the offending code:
    @recognized_route ||= ::ActionController::Routing::Routes.routes_for_controller_and_action(controller_path, action_name).find { |route| ... }

    routes_for requires controller and action to be defined, but I was unable to figure out where it is supposed to get these from and how to set the correct values from the plugin.

    September 7th, 2009 @ 05:57 AM

  14. Ian White
    Ian White

    The deprecation warning suggests that the routes_for method be used instead. Hoowever, this method doesn't work. It references a controller and action local var that are not in scope. I'm wondering if this new method was partially implemented?

    Also, there are no tests that I could find for this method.

    September 11th, 2009 @ 08:41 PM