I upgraded my 1.2.6 app to 2.0.2 with all tests passing. I then rewrote
the fixtures with the new rails 2 ''foxy fixtures'' style, e.g.
referencing fixture names instead of ids. I''m now getting a ton of
errors like the following:
1)
ActiveRecord::StatementInvalid in ''LineItemCache truth''
PGError: ERROR: column "line_item" of relation
"line_item_caches" does
not exist
LINE 1: ...item_caches ("cached_product_name", "unit_price",
"line_item...
^
: INSERT INTO line_item_caches ("cached_product_name",
"unit_price",
"line_item") VALUES (E''foo'', 1,
E''li_prep_time_7'')
Looks like it''s not detecting the model relationships in this case.
Here''s the relevant fixture and model info:
line_item_caches.yml:
DEFAULTS: &DEFAULTS
cached_product_name: foo
unit_price: 1
lic1:
line_item: li1
<<: *DEFAULTS
line_items.yml:
DEFAULTS: &DEFAULTS
special_ins: asdf
unit_price: 1
quantity: 1
li1:
product: small_espresso
order: order1
user: joe
<<: *DEFAULTS
line_item.rb:
class LineItem < ActiveRecord::Base
has_one :line_item_cache, :dependent => :destroy
end
line_item_cache.rb:
class LineItemCache < ActiveRecord::Base
belongs_to :line_item
end
Funny thing is, sometimes it does pick up the names, but then I get
another wierd error where it thinks #<YAML::Syck::MergeKey:0xb6f040b8>
is a column name:
1)
ActiveRecord::StatementInvalid in ''Location hours by type''
PGError: ERROR: column "#<YAML::Syck::MergeKey:0xb6f040b8>" of
relation
"orders" does not exist
LINE 1: ..., "id", "pickup_time", "user_id",
"order_number",
"#<YAML::S...
^
: INSERT INTO orders ("status", "location_id",
"id", "pickup_time",
"user_id", "order_number",
"#<YAML::Syck::MergeKey:0xb6f040b8>",
"created_at") VALUES (E''open'', 673263714,
1026752367, E''2008-05-07
03:40:00'', 910594905, 12345, E''--- &id001
status: open
pickup_time: 2008-05-07 03:40:00
!ruby/object:YAML::Syck::MergeKey ? {}
: *id001
location: joes_coffee
'', E''2008-05-07 03:18:05.670587'')
Anyone had a similar problem?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---