Nick Sieger: ActiveRecord-JDBC 0.2.3 Released tag:blog.nicksieger.com,2005:Typo Typo 2007-08-31T17:28:12+00:00 Pradeep urn:uuid:f305aa89-18f3-44d2-bd15-edc95385e471 2007-03-16T18:30:36+00:00 2007-08-31T17:28:12+00:00 Comment 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: [[&#8220;bit&#8221;, {&#8220;nullable&#8221;=>1, &#8220;num<em>prec</em>radix&#8221;=>nil, &#8220;local<em>type</em>name&#8221;=>&#8221;bit&#8221;, &#8230;&#8230;</p> <p>Looks like it is choking on a tinyint field.</p> <p>Any ideas ?</p> Ed Powell urn:uuid:16d1539a-2883-48bf-8a99-260c6f975f26 2007-03-10T06:02:56+00:00 2007-08-31T17:28:12+00:00 Comment 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] = &#8220;bigint unsigned DEFAULT NULL auto</em>increment PRIMARY KEY&#8221; tp[:decimal] = { :name => &#8220;decimal&#8221; } tp[:longtext] = { :name => &#8220;longtext&#8221; } tp[:ubigint] = { :name => &#8220;bigint unsigned&#8221; } tp end end end</p> Nick urn:uuid:98c295e6-f097-4fdf-9624-09d94f3b6add 2007-03-08T02:49:40+00:00 2007-08-31T17:28:12+00:00 Comment 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&amp;view=markup' rel="nofollow"><code>JDBC::MySQL#modify_types</code></a> method. See if you can redefine for your purposes.</p> Nick urn:uuid:2b7e2708-9cd1-4db9-90df-87fa9431d418 2007-03-08T02:46:15+00:00 2007-08-31T17:28:12+00:00 Comment 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&amp;group_id=2014&amp;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> RG urn:uuid:94a3efd9-4433-4f9c-a296-a4c0fc2c7ae7 2007-03-06T23:16:49+00:00 2007-08-31T17:28:11+00:00 Comment on ActiveRecord-JDBC 0.2.3 Released by RG What might cause this error? undefined method `Title&#8217; for #<product:0x214f6b>&#8220;Bubble bath&#8221;, &#8220;title&#8221;=>&#8221;Foamy&#8221;, &#8220;id&#8221;=>1}> Extracted source (around line #13): 10: &lt;% for product in @products %> 11: <tr> 12: &lt;% for column in Product.content_columns %> 13: <td>&lt;%=h product.send(column.name) %></td> 14: &lt;% end %> 15: <td>&lt;%= link_to 'Show', :action => &#8216;show&#8217;, :id => product %></td> 16: <td>&lt;%= link_to 'Edit', :action => &#8216;edit&#8217;, :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&#8217; C:/jruby-0.9.8/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/base.rb:1861:in `method_missing&#8217; #{RAILS_ROOT}/app/views/products/list.rhtml:13:in `send&#8217; #{RAILS_ROOT}/app/views/products/list.rhtml:13:in `_run_rhtml_47app47views47products47list46rhtml&#8217; #{RAILS_ROOT}/app/views/products/list.rhtml:14:in `_run_rhtml_47app47views47products47list46rhtml&#8217; #{RAILS_ROOT}/app/views/products/list.rhtml:19:in `_run_rhtml_47app47views47products47list46rhtml&#8217; app/controllers/products_controller.rb:4:in `measure&#8217; app/controllers/products_controller.rb:4:in `index&#8217; Ed Powell urn:uuid:7b1dd355-fa62-4663-9588-6290fbe1c296 2007-03-06T15:49:25+00:00 2007-08-31T17:28:11+00:00 Comment 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 &#8216;bigint unsigned&#8217; and :longtext for &#8216;longtext&#8217;).</p> <p>I haven&#8217;t been able to figure out how to do the same with ActiveRecord-JDBC yet. Any thoughts?</p> Nick Sieger urn:uuid:11809439-cf89-4dc7-9fe1-933dc6609ebc 2007-03-06T03:58:00+00:00 2007-08-31T17:28:11+00:00 ActiveRecord-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&#8217;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&#8217;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>