Hi John, Nice fix!
We will also report the jdbc-mysql adapter issue to the maintainers. Thanks a lot. Regards. Gonzalo. 2009/6/23 John Mettraux <[email protected]>: > > On Tue, Jun 23, 2009 at 1:55 AM, Gonzalo<[email protected]> wrote: >> >> I commented out the lines in 'vendor/ruote/lib/openwfe/extras/ >> singlecon.rb' as you suggested in the last post and most of the the >> tests pass now with jruby1.3.0 >> >> Only, 'test/st_errors.rb' and 'test/st_expressions.rb' still fail >> because XML problems I think... I'll try to find more on that and fix >> it. > > Hello Gonzalo, > > OK, understood, waiting for your feedback. > >> On the other hand, my co-worker Nando found an issue when requesting >> "GET /history" (ruote-rest + jruby). It seems that using jdbcmysql >> adapter makes SQL queries not to return a Mysql::Request object but a >> simple Hash. When the method fetch_row is invoked on that Hash, an >> error rises. >> >> We came out with the following fix for that. >> Edit 'lib/res/history.rb' >> >> 70 #total = ActiveRecord::Base::connection.execute( >> 71 # 'select count(*) from history').fetch_row[0].to_i >> 72 >> 73 total = ActiveRecord::Base::connection.execute('select count(*) >> from history') >> 74 total = total.respond_to?("fetch_row") ? total.fetch_row >> [0].to_i : total.fetch(0).fetch("count(*)").to_i >> >> Now the code above will work fine whether you run ruote-rest with ruby >> or with jruby :) > > So, would it be worth reporting the issue to the maintainers of the > jdbc-mysql bridge ? > > On the other hand I took a closer look at the active-record > documentation and came up with that modification which happily works > with Ruby and JRuby : > > http://github.com/jmettraux/ruote-rest/commit/b52b06c9b2214944c16bf292f460d1f8f429784e > > > Thanks a lot, > > -- > John Mettraux - http://jmettraux.wordpress.com > > > > --~--~---------~--~----~------------~-------~--~----~ you received this message because you are subscribed to the "ruote users" group. to post : send email to [email protected] to unsubscribe : send email to [email protected] more options : http://groups.google.com/group/openwferu-users?hl=en -~----------~----~----~----~------~----~------~--~---
