Nick Sieger: ActiveRecord-JDBC 0.2.3 Releasedtag:blog.nicksieger.com,2005:TypoTypo2007-08-31T17:28:12+00:00Pradeepurn:uuid:f305aa89-18f3-44d2-bd15-edc95385e4712007-03-16T18:30:36+00:002007-08-31T17:28:12+00:00Comment on ActiveRecord-JDBC 0.2.3 Released by Pradeep<p>I just tried jruby with an app we have going against a MSSQLServer database. Got this error -</p>
<p>The driver encounter an error: unable to choose type from: [[“bit”, {“nullable”=>1, “num<em>prec</em>radix”=>nil, “local<em>type</em>name”=>”bit”, ……</p>
<p>Looks like it is choking on a tinyint field.</p>
<p>Any ideas ?</p>Ed Powellurn:uuid:16d1539a-2883-48bf-8a99-260c6f975f262007-03-10T06:02:56+00:002007-08-31T17:28:12+00:00Comment on ActiveRecord-JDBC 0.2.3 Released by Ed Powell<p>Ah, got it. Added the following to the end of my environment.rb:</p>
<p>module JdbcSpec
module MySQL
def modify_types(tp)
tp[:primary<em>key] = “bigint unsigned DEFAULT NULL auto</em>increment PRIMARY KEY”
tp[:decimal] = { :name => “decimal” }
tp[:longtext] = { :name => “longtext” }
tp[:ubigint] = { :name => “bigint unsigned” }
tp
end
end
end</p>Nickurn:uuid:98c295e6-f097-4fdf-9624-09d94f3b6add2007-03-08T02:49:40+00:002007-08-31T17:28:12+00:00Comment on ActiveRecord-JDBC 0.2.3 Released by Nick<p>@Ed: Have a look at the <a href='http://rubyforge.org/viewvc/trunk/activerecord-jdbc/lib/jdbc_adapter/jdbc_mysql.rb?root=jruby-extras&view=markup' rel="nofollow"><code>JDBC::MySQL#modify_types</code></a> method. See if you can redefine for your purposes.</p>Nickurn:uuid:2b7e2708-9cd1-4db9-90df-87fa9431d4182007-03-08T02:46:15+00:002007-08-31T17:28:12+00:00Comment on ActiveRecord-JDBC 0.2.3 Released by Nick<p>@RG: Hey, thanks for the report. Could I persuade you to post a bug report in the <a href='http://rubyforge.org/tracker/?func=add&group_id=2014&atid=7857' rel="nofollow">Rubyforge tracker</a>? If possible please include some details of the model/database/table structure that caused the issue. Thanks!</p>RGurn:uuid:94a3efd9-4433-4f9c-a296-a4c0fc2c7ae72007-03-06T23:16:49+00:002007-08-31T17:28:11+00:00Comment on ActiveRecord-JDBC 0.2.3 Released by RGWhat might cause this error?
undefined method `Title’ for #<product:0x214f6b>“Bubble bath”, “title”=>”Foamy”, “id”=>1}>
Extracted source (around line #13):
10: <% for product in @products %>
11: <tr>
12: <% for column in Product.content_columns %>
13: <td><%=h product.send(column.name) %></td>
14: <% end %>
15: <td><%= link_to 'Show', :action => ‘show’, :id => product %></td>
16: <td><%= link_to 'Edit', :action => ‘edit’, :id => product %></td>
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’
Ed Powellurn:uuid:7b1dd355-fa62-4663-9588-6290fbe1c2962007-03-06T15:49:25+00:002007-08-31T17:28:11+00:00Comment on ActiveRecord-JDBC 0.2.3 Released by Ed Powell<p>With ActiveRecord, I can (and do) override the ActiveRecord::ConnectionAdapters::MysqlAdapter native<em>database</em>types method, to specify additional column types (:ubigint for ‘bigint unsigned’ and :longtext for ‘longtext’).</p>
<p>I haven’t been able to figure out how to do the same with ActiveRecord-JDBC yet. Any thoughts?</p>Nick Siegerurn:uuid:11809439-cf89-4dc7-9fe1-933dc6609ebc2007-03-06T03:58:00+00:002007-08-31T17:28:11+00:00ActiveRecord-JDBC 0.2.3 Released<p>ActiveRecord-JDBC version 0.2.3 has been released!</p>
<h3>Install</h3>
<p>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.</p>
<div class="typocode"><pre><code class="typocode_default ">$ 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...</code></pre></div>
<p>See <a href="http://jruby-extras.rubyforge.org/ActiveRecord-JDBC">the new RDoc documentation on Rubyforge</a> for more information on how to use ActiveRecord-JDBC. If you’re grabbing the <a href="/articles/2007/03/06/countdown-to-1-0-jruby-0-9-8-released">new JRuby 0.9.8 release</a>, be sure you get this one as well if you plan to try out <a href="http://www.headius.com/jrubywiki/index.php/JRuby_on_Rails">JRuby on Rails</a>.</p>
<h3>Changes</h3>
<ul>
<li>Release coincides (and compatible) with JRuby 0.9.8 release</li>
<li><a href="http://rubyurl.com/0Da">8 bugs fixed</a></li>
<li>Improvements and compatibility fixes for Rails 1.2.x</li>
</ul>
<p>Comments, questions, test cases, patches and all that are welcome over on the <a href="http://rubyforge.org/mail/?group_id=2014">jruby-extras mailing list</a>.</p>