У меня есть 3 модели: Марка, Модель и Оборудование. Марка встраивает модель, Модель встраивает оборудование. В разработке на OSX все работает нормально, но на производстве на EC2 Ubuntu 10.04 Equipment проходит все проверки, говорит true для методов создания и сохранения и даже выводит «Оборудование успешно создано», но не отображается в db.
ruby-1.9.2-p180 :002 > b = Brand.create!(:title => "Volvo", :logo_file_name => "some_logo.png")
=> #<Brand _id: 4da29833b177070722000002, _type: nil, _id: BSON::ObjectId('4da29833b177070722000002'), title: "Volvo", logo_file_name: "some_logo.png", logo_content_type: nil, logo_file_size: nil, logo_updated_at: nil, active: true>
ruby-1.9.2-p180 :007 > m = b.models.create!(:title => "740")
=> #<Model _id: 4da29893b177070722000004, _type: nil, _id: BSON::ObjectId('4da29893b177070722000004'), title: "740", active: true>
ruby-1.9.2-p180 :024 > e = m.equipment.create!(:title => "1.6 Turbo", :start => 1987, :stop => 1993)
=> #<Equipment _id: 4da29a42b177070722000006, _type: nil, _id: BSON::ObjectId('4da29a42b177070722000006'), title: "1.6 Turbo", start: 1987, stop: 1993, acive: true, image_file_name: nil, image_content_type: nil, image_file_size: nil, image_updated_at: nil>
ruby-1.9.2-p180 :025 > bb = Brand.last
=> #<Brand _id: 4da29833b177070722000002, _type: nil, _id: BSON::ObjectId('4da29833b177070722000002'), title: "Volvo", logo_file_name: "some_logo.png", logo_content_type: nil, logo_file_size: nil, logo_updated_at: nil, active: true>
ruby-1.9.2-p180 :026 > mm = bb.models.last
=> #<Model _id: 4da29893b177070722000004, _type: nil, _id: BSON::ObjectId('4da29893b177070722000004'), title: "740", active: true>
ruby-1.9.2-p180 :027 > ee = mm.equipment.last
=> nil
ruby-1.9.2-p180 :032 > mm.equipment
=> []
ruby-1.9.2-p180 :033 > e = m.equipment.new
=> #<Equipment _id: 4da29b15b177070722000008, _type: nil, _id: BSON::ObjectId('4da29b15b177070722000008'), title: nil, start: nil, stop: nil, acive: true, image_file_name: nil, image_content_type: nil, image_file_size: nil, image_updated_at: nil>
ruby-1.9.2-p180 :034 > e.title = "1.8 SLE"
=> "1.8 SLE"
ruby-1.9.2-p180 :035 > e.start = 1988
=> 1988
ruby-1.9.2-p180 :036 > e.stop = 1994
=> 1994
ruby-1.9.2-p180 :037 > e.save!
=> true
ruby-1.9.2-p180 :038 > bb = Brand.last
=> #<Brand _id: 4da29833b177070722000002, _type: nil, _id: BSON::ObjectId('4da29833b177070722000002'), title: "Volvo", logo_file_name: "some_logo.png", logo_content_type: nil, logo_file_size: nil, logo_updated_at: nil, active: true>
ruby-1.9.2-p180 :040 > mm = bb.models.last
=> #<Model _id: 4da29893b177070722000004, _type: nil, _id: BSON::ObjectId('4da29893b177070722000004'), title: "740", active: true>
ruby-1.9.2-p180 :041 > ee = mm.equipment.last
=> nil
Почему это могло произойти?