This project is archived and is in readonly mode.

app.my_path_url is protected
Reported by Paul Sadauskas (Rando) | May 26th, 2010 @ 12:31 AM | in 3.0.2
Happens in beta3 and master:
./script/rails c
Loading development environment (Rails 3.0.0.beta3)
ree-1.8.7-2010.01 > app.escalation_definitions_path
NoMethodError: protected method `escalation_definitions_path' called for #<ActionDispatch::Integration::Session:0x105500090>
    from /Users/rando/.rvm/gems/ree-1.8.7-2010.01/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/actionpack/lib/action_dispatch/testing/assertions/routing.rb:175:in `method_missing'
    from (irb):1
ree-1.8.7-2010.01 > app.escalation_definitions_url
NoMethodError: protected method `escalation_definitions_url' called for #<ActionDispatch::Integration::Session:0x105500090>
    from /Users/rando/.rvm/gems/ree-1.8.7-2010.01/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/actionpack/lib/action_dispatch/testing/assertions/routing.rb:175:in `method_missing'
    from (irb):2
    from :0
Comments and changes to this ticket
- 
         Yehuda Katz (wycats) May 26th, 2010 @ 12:31 AM- Milestone cleared.
- State changed from new to open
 
- 
         Rohit Arondekar May 26th, 2010 @ 01:04 PMI'm getting undefined method for Rails master on 1.9.2-head 
 NoMethodError: undefined methodescalation_definitions_path' for #<ActionDispatch::Integration::Session:0x000000033caa98><br/>from /home/rohit/remote-repos/rails_patches/working4/actionpack/lib/action_dispatch/testing/assertions/routing.rb:175:in `method_missing'Similarly for _url 
- 
         Michael Koziarski June 1st, 2010 @ 10:37 PM- Milestone cleared.
 
- 
         Rohit Arondekar June 5th, 2010 @ 06:38 AMConfirmed on Rails master. Steps to reproduce: 
 1] Create a rails app
 2] Generate a resource, rails g resource post
 3] Open rails console, rails c
 4] app.posts_path, will throw a protected method called error.What I found was in route_set.rb in /actionpack/lib/action_dispatch/routing/ the define_url_helper() method has a protected in front of :#{selector} Line nos 179. If I remove the protected, the above issue is resolved, the method is no longer protected. However a test fails. 
 
 1) Failure:
 test_url_helpers_does_not_become_actions(UrlOptionsTest) [test/controller/base_test.rb:230]:
 Failed assertion, no message given.The following assert fails, 
 
 assert !@controller.class.action_methods.include?("account_overview_path")I don't know if the test needs fixing or the code. 
- 
         Repository June 7th, 2010 @ 08:30 PM- State changed from open to resolved
 (from [eebac026060ef9a5e69e69b01df61acee7c6c07f]) Make named helpers unprotected without becoming actions [#4696 state:resolved] http://github.com/rails/rails/commit/eebac026060ef9a5e69e69b01df61a... 
- 
         Neeraj Singh June 7th, 2010 @ 09:13 PM15 minutes ago it was not fixed. And now that I am ready to attach a patch it is fixed. Anyway attaching my patch :-) 
- 
         Jeremy Kemper October 15th, 2010 @ 11:01 PM- Milestone set to 3.0.2
- Importance changed from  to High
 
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 
         4696 
          app.my_path_url is protected
        (from [eebac026060ef9a5e69e69b01df61acee7c6c07f])
Make na... 4696 
          app.my_path_url is protected
        (from [eebac026060ef9a5e69e69b01df61acee7c6c07f])
Make na...
 Jeremy Kemper
      Jeremy Kemper
 Michael Koziarski
      Michael Koziarski
 Paul Sadauskas (Rando)
      Paul Sadauskas (Rando)
 Yehuda Katz (wycats)
      Yehuda Katz (wycats)