ActiveRecord-JDBC 0.2.3 Released

Posted by Nick Sieger Tue, 06 Mar 2007 03:58:00 GMT

ActiveRecord-JDBC version 0.2.3 has been released!

Install

Use JRuby to install the gem into your JRuby installation as follows. Currently, Rails is not a dependency of ActiveRecord-JDBC; it is assumed you’re going to have Rails installed already.

$ jruby --command gem install ActiveRecord-JDBC
Successfully installed ActiveRecord-JDBC-0.2.3
Installing ri documentation for ActiveRecord-JDBC-0.2.3...
Installing RDoc documentation for ActiveRecord-JDBC-0.2.3...

See the new RDoc documentation on Rubyforge for more information on how to use ActiveRecord-JDBC. If you’re grabbing the new JRuby 0.9.8 release, be sure you get this one as well if you plan to try out JRuby on Rails.

Changes

  • Release coincides (and compatible) with JRuby 0.9.8 release
  • 8 bugs fixed
  • Improvements and compatibility fixes for Rails 1.2.x

Comments, questions, test cases, patches and all that are welcome over on the jruby-extras mailing list.

Tags , ,  | 6 comments | no trackbacks

Comments

  1. Avatar Ed Powell said about 12 hours later:

    With ActiveRecord, I can (and do) override the ActiveRecord::ConnectionAdapters::MysqlAdapter nativedatabasetypes method, to specify additional column types (:ubigint for ‘bigint unsigned’ and :longtext for ‘longtext’).

    I haven’t been able to figure out how to do the same with ActiveRecord-JDBC yet. Any thoughts?

  2. Avatar RG said about 19 hours later:
    What might cause this error? undefined method `Title’ for #“Bubble bath”, “title”=>”Foamy”, “id”=>1}> Extracted source (around line #13): 10: <% for product in @products %> 11: 12: <% for column in Product.content_columns %> 13: <%=h product.send(column.name) %> 14: <% end %> 15: <%= link_to 'Show', :action => ‘show’, :id => product %> 16: <%= link_to 'Edit', :action => ‘edit’, :id => product %> RAILS_ROOT: script/../config/.. Application Trace | Framework Trace | Full Trace C:/jruby-0.9.8/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/base.rb:1861:in `method_missing’ C:/jruby-0.9.8/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/base.rb:1861:in `method_missing’ #{RAILS_ROOT}/app/views/products/list.rhtml:13:in `send’ #{RAILS_ROOT}/app/views/products/list.rhtml:13:in `_run_rhtml_47app47views47products47list46rhtml’ #{RAILS_ROOT}/app/views/products/list.rhtml:14:in `_run_rhtml_47app47views47products47list46rhtml’ #{RAILS_ROOT}/app/views/products/list.rhtml:19:in `_run_rhtml_47app47views47products47list46rhtml’ app/controllers/products_controller.rb:4:in `measure’ app/controllers/products_controller.rb:4:in `index’
  3. Avatar Nick said 1 day later:

    @RG: Hey, thanks for the report. Could I persuade you to post a bug report in the Rubyforge tracker? If possible please include some details of the model/database/table structure that caused the issue. Thanks!

  4. Avatar Nick said 1 day later:

    @Ed: Have a look at the JDBC::MySQL#modify_types method. See if you can redefine for your purposes.

  5. Avatar Ed Powell said 4 days later:

    Ah, got it. Added the following to the end of my environment.rb:

    module JdbcSpec module MySQL def modify_types(tp) tp[:primarykey] = “bigint unsigned DEFAULT NULL autoincrement PRIMARY KEY” tp[:decimal] = { :name => “decimal” } tp[:longtext] = { :name => “longtext” } tp[:ubigint] = { :name => “bigint unsigned” } tp end end end

  6. Avatar Pradeep said 10 days later:

    I just tried jruby with an app we have going against a MSSQLServer database. Got this error -

    The driver encounter an error: unable to choose type from: [[“bit”, {“nullable”=>1, “numprecradix”=>nil, “localtypename”=>”bit”, ......

    Looks like it is choking on a tinyint field.

    Any ideas ?

Trackbacks

Use the following link to trackback from your own site:
http://blog.nicksieger.com/articles/trackback/216