2

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 10:25 PM by jredville
manual verified + defined specs pass

comments

jimmysch wrote May 27, 2009 at 10:45 PM

Rake also runs into something similar (causes a couple test failures)

wrote Aug 5, 2009 at 2:33 PM

riles01 wrote Aug 6, 2009 at 6:15 PM

More details re: the bug and eval-ing the Rails URL helper. (See attached.)

wrote Aug 6, 2009 at 6:15 PM

sborde wrote Aug 6, 2009 at 7: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

wrote Aug 6, 2009 at 7:12 PM

sborde wrote Sep 8, 2009 at 6: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.

TomasMatousek wrote Oct 8, 2009 at 2:32 AM

This was caused by defined? not respecting method visibility:
class C
protected
def foo
end
end

p defined?(C.new.foo)

wrote Dec 7, 2009 at 5:52 AM

wrote Dec 7, 2009 at 10:25 PM

wrote Dec 7, 2009 at 10:38 PM

wrote Feb 21, 2013 at 11:40 PM

wrote May 16, 2013 at 11:05 AM