Evaling method definitions inside of Rails model classes fails
--------------------------------------------------------------
Key: JRUBY-1276
URL: http://jira.codehaus.org/browse/JRUBY-1276
Project: JRuby
Issue Type: Bug
Reporter: Ola Bini
Assignee: Thomas E Enebo
Priority: Minor
Haven't had time to pinpoint this, but if I put code like this in a Rails
project:
{noformat}
class Script < ActiveRecord::Base
def run
eval(<<SCRIPT)
def foo
"hello"
end
foo()
SCRIPT
end
end
{noformat}
and runs it from the controller, it will fail, saying it can't find the
foo-method. I've tried it with an explicit binding too, which doesn't work
either. The same eval is fine from for example a controller.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email