accessing attributes hash do not dezerialize on activerecord-jdbcsqlite3-adapter
--------------------------------------------------------------------------------

                 Key: JRUBY-3824
                 URL: http://jira.codehaus.org/browse/JRUBY-3824
             Project: JRuby
          Issue Type: Bug
    Affects Versions: ActiveRecord-JDBC-0.9.1
         Environment: jruby 1.2.0 
rails 2.3.3
activerecord-jdbcsqlite3-adapter 0.9.1
jdbc-sqlite3 3.6.3.054

            Reporter: Peter Ehrenberg
            Assignee: Thomas E Enebo


Accessing an serialized attribute by attribute hash (attributes or self[:attr]) 
do not dezerialize value. Only after accessing via getter one get dezerialize 
value

class CreateMyrecord < ActiveRecord::Migration
  def self.up
    create_table :myrecords do |t|
      t.string :myattr
    end
  end
end


class Myrecord < ActiveRecord::Base
  serialize :myattr
end


Myrecord.create :myattr => [1,2,3]      => #<Myrecord id: 2, myattr: [1, 2, 3]>
m = Myrecord.first                                 => #<Myrecord id: 2, myattr: 
"--- \n- 1\n- 2\n- 3\n">
m[:myattr]                                                => "--- \n- 1\n- 2\n- 
3\n"
m.myattr                                                  => [1, 2, 3]
m[:myattr]                                                => [1, 2, 3]



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to