Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.1.2
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      OS X 10.5.3, JRuby r7022, Rails 2.1.0, activerecord-jdbc-adapter 0.8.2, activerecord-jdbc-sqlite3-adapter 0.8.1 jdbc-sqlite3 3.5.8
    • Number of attachments :
      0

      Description

      Assume a Model class created by migration such as this:

      class CreateModels < ActiveRecord::Migration
      def self.up
      create_table :models do |t|
      t.column :prop, :string, :default => ''

      t.timestamps
      end
      end

      def self.down
      drop_table :models
      end
      end

      This will yield:

      $ jruby script/console
      Loading development environment (Rails 2.1.0)
      >> m=Model.new
      => #<Model id: nil, prop: nil, created_at: nil, updated_at: nil>

      The same model, with MRI 1.8.6-p111, Rails 2.1.0, sqlite3-ruby 1.2.1, yields:

      $ ruby script/console
      Loading development environment (Rails 2.1.0)
      >> m=Model.new
      => #<Model id: nil, prop: "", created_at: nil, updated_at: nil>

        Activity

        Hide
        Charles Oliver Nutter added a comment -

        Seems like a simple enough change. Have you any opportunity to look at the code and see where to fix it?

        Show
        Charles Oliver Nutter added a comment - Seems like a simple enough change. Have you any opportunity to look at the code and see where to fix it?
        Hide
        Hiro Asari added a comment -

        It appears to me that somehow _def is not set correctly in JdbcAdapterInternalService.unmarshall_columns() prior to calling 'new' on JdbcColumn.

        Show
        Hiro Asari added a comment - It appears to me that somehow _def is not set correctly in JdbcAdapterInternalService.unmarshall_columns() prior to calling 'new' on JdbcColumn.
        Hide
        Ferdinand Svehla added a comment -

        Still present in 1.1.6

        Show
        Ferdinand Svehla added a comment - Still present in 1.1.6
        Hide
        Charles Oliver Nutter added a comment -

        Any patch suggestions?

        Show
        Charles Oliver Nutter added a comment - Any patch suggestions?
        Hide
        Thomas E Enebo added a comment -

        Fixed in commit 2eae624. This also fixes h2/hsqldb/derby for the same problem.

        Show
        Thomas E Enebo added a comment - Fixed in commit 2eae624. This also fixes h2/hsqldb/derby for the same problem.

          People

          • Assignee:
            Thomas E Enebo
            Reporter:
            Hiro Asari
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: