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.

[PATCH] load initializers before routing

#3709

in rails 3, when irregular inflections used, routes are not created correctly.

ActiveSupport::Inflector.inflections do |inflect|
inflect.irregular 'yazi', 'yazilar' end

$ rake routes

  yazilars GET    /yazilars(.:format)            {:action=>"index", :controller=>"yazilars"}
           POST   /yazilars(.:format)            {:action=>"create", :controller=>"yazilars"}

new_yazilar GET /yazilars/new(.:format) {:action=>"new", :controller=>"yazilars"}

   yazilar GET    /yazilars/:id(.:format)        {:action=>"show", :controller=>"yazilars"}
           PUT    /yazilars/:id(.:format)        {:action=>"update", :controller=>"yazilars"}
           DELETE /yazilars/:id(.:format)        {:action=>"destroy", :controller=>"yazilars"}

edit_yazilar GET /yazilars/:id/edit(.:format) {:action=>"edit", :controller=>"yazilars"}

Reported by phrewww · January 16th, 2010 @ 05:43 PM

State: resolved
Milestone: 3.0.2
Assigned to: josh josh
Importance: Medium

Activity

  1. phrewww
    phrewww
    • Assigned user set to josh

    January 16th, 2010 @ 06:05 PM

  2. phrewww
    phrewww

    it seems that inflections are loaded after routes, so inflections are not correctly used.

    January 16th, 2010 @ 07:11 PM

  3. phrewww
    phrewww

    here is the patch, to load initializers before routing, it needs tests Joshua, the tests are not included

    January 16th, 2010 @ 07:55 PM

  4. phrewww
    phrewww
    • Title changed from irregular inflection routes are not created correctly to [PATCH] load initializers before routing

    title update

    January 16th, 2010 @ 07:56 PM

  5. josh
    josh
    • Milestone cleared.
    • State changed from new to open

    January 16th, 2010 @ 08:43 PM

  6. Rizwan Reza
    Rizwan Reza
    • Tag set to 3.0, patch, review

    +1 Verified

    This patch applies cleanly.

    January 16th, 2010 @ 09:28 PM

  7. Matt Jones
    Matt Jones

    Was there a particular reason this behavior was changed in the rewrite of the initializer? It appears that initializers were before routes as of 2.3.5...

    January 16th, 2010 @ 09:33 PM

  8. Repository
    Repository
    • State changed from open to resolved

    January 16th, 2010 @ 10:15 PM

  9. Prem Sichanugrist (sikachu)
  10. Jeremy Kemper
    Jeremy Kemper
    • Milestone set to 3.0.2
    • Importance changed from to Medium

    October 15th, 2010 @ 11:01 PM