Hi everyone,
I'm in the early stages of using JRuby on Rails to build an
administration webapp for a travel site. So far it's looking
promising, although I've so far spent most of the time by far working
out kinks in the configuration. I need to talk to a MSSQL server using
JNDI, all running on an Oracle app server, and by now it's actually
working out fine (if I disable the Java security manager - I made
another post on that).
Anyway, my present problem is that upgrading to ActiveRecord-JDBC
0.2.4 seems to introduce an error related to aliasing. I have an alias
for the column 'udbyderId', which is called 'udbyderid' in the model
(alias_attribute :udbyderId, :udbyderid).
I should note that this is in the dev environment where I'm not using
JNDI but JDBC and WEBrick instead of Oracle, and MySQL in place of
MSSQL - but, rather impressingly, the error below is the same in both
environments.
Using ActiveRecord-JDBC 0.2.3 my webapp can connect to the database
and show a list of records. Everybody's happy.
Using ActiveRecord-JDBC 0.2.4 in exactly the same configuration gives
the following error:
NameError in Rejsetilbud#index
Showing app/views/rejsetilbud/list.rhtml where line #13 raised:
undefined local variable or method 'udbyderid' for
#<Rejsetilbud:0x374059 @attributes={"mainPictureId"=>"0",
[..snip..]
"rejsetilbudsId"=>"1", "udbyderId"=>"123", }>
Extracted source (around line #13):
10: <% for rejsetilbud in @rejsetilbud %>
11: <tr>
12: <% for column in Rejsetilbud.content_columns %>
13: <td><%=h rejsetilbud.send(column.name) %></td>
14: <% end %>
15: <td><%= link_to 'Show', :action => 'show', :id => rejsetilbud %></td>
16: <td><%= link_to 'Edit', :action => 'edit', :id => rejsetilbud %></td>
RAILS_ROOT: script/../config/..
Application Trace | Framework Trace | Full Trace
/Users/slehmann/svn/jruby_trunk/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1860:in
`method_missing'
/Users/slehmann/svn/jruby_trunk/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1860:in
`method_missing'
/Users/slehmann/svn/jruby_trunk/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/core_ext/module/aliasing.rb:0:in
`udbyderId'
#{RAILS_ROOT}/app/views/rejsetilbud/list.rhtml:13:in `send'
#{RAILS_ROOT}/app/views/rejsetilbud/list.rhtml:13:in
`_run_rhtml_47app47views47rejsetilbud47list46rhtml'
#{RAILS_ROOT}/app/views/rejsetilbud/list.rhtml:14:in
`_run_rhtml_47app47views47rejsetilbud47list46rhtml'
#{RAILS_ROOT}/app/views/rejsetilbud/list.rhtml:19:in
`_run_rhtml_47app47views47rejsetilbud47list46rhtml'
app/controllers/rejsetilbud_controller.rb:4:in `measure'
app/controllers/rejsetilbud_controller.rb:4:in `index'
Should I create a JIRA issue? Can't be that something blatantly
obvious is wrong since it works with the 0.2.3 ActiveRecord-JDBC. Is
there some information I need to include with the issue report, or
have I gone overboard already? :-)
Kind regards,
-- Steen
[EMAIL PROTECTED]
Principal Consultant
Jayway Denmark
P. S. The svn:externals property in the rails-integration
samples/helloworld-1.2.3/vendor/plugins directory needs to be updated
following the name change to goldspike. It refers to null and void at
the moment, and so you can't 'svn up' the project.
_______________________________________________
Jruby-extras-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/jruby-extras-devel