Hi, I'm sure I'm doing something obviously incorrect here, but have
stared at it for so long I can't seem to find it.
I want to serialize some activerecord objects as rows in a table.
Basically I can:
import_object = ImportObject.new
=> #<ImportObject id: nil, object: nil, created_at: nil, updated_at:
import_object.object = Fubar.find(32)
=> #<Fubar id: 32, name: "Fubar'd" >
=> #<ImportObject id: 2958, object: #<Fubar id: 32, name: "Fubar'd" >,
created_at: "2009-07-15 22:42:40", updated_at: "2009-07-15 22:42:40">
Perfect! Until I save....
io = ImportObject.find(2958)
=> #<ImportObject id: 2958, import_id: nil, object: 32, created_at:
"2009-07-15 22:42:40", updated_at: "2009-07-15 23:10:11">
For some reason the object is getting saved as a fixnum, and I can't
figure out why. Any ideas?
Here's the setup:
class CreateImportObjects < ActiveRecord::Migration
create_table :import_objects do |t|
t.string :object, :limit => 512
class ImportObject < ActiveRecord::Base