2 votes
closed
Rails Controllers need public :default_url_options

Description

 
Rails Controllers need public :default_url_options to work.

File Attachments


Closed Dec 7 2009 at 11:25 PM  by jredville

manual verified + defined specs pass


Comments

most recent at top (show oldest at top)
TomasMatousek wrote Oct 8 2009 at 3:32 AM
This was caused by defined? not respecting method visibility:
class C
protected
def foo
end
end

p defined?(C.new.foo)

sborde wrote Sep 8 2009 at 7:59 PM
Merlin\Main\Languages\Ruby\Tests\Scripts\ActionPackTests.rb might have a simpler standalone test case - there is a tag to disable test_link_to_unless_current_shows_link(LinkToUnlessCurrentWithControllerTest) which fails with the same issue.

sborde wrote Aug 6 2009 at 8:12 PM
In RubyCallAction.BuildCall, Resolve returns a MethodResulutionResult where _info does point to the right Ruby method (ActionController::Base#default_url_options), but _visible is set to false. Need to drill into Resolve to see what value is being used for the visibilityContext.

Attaching a file where eval calls a protected method of another class using the binding of that class. This simple repro does work with IronRuby.

Btw, for the repro, see http://ironruby.net/documentation/rails#scaffolding

riles01 wrote Aug 6 2009 at 7:15 PM
More details re: the bug and eval-ing the Rails URL helper. (See attached.)

jimmysch wrote May 27 2009 at 11:45 PM
Rake also runs into something similar (causes a couple test failures)

Updating...
© 2006-2010 Microsoft | About CodePlex | Privacy Statement | Terms of Use | Code of Conduct | Advertise With Us | Version 2010.1.12.16187