Stallion
(Stallion)
1
Hi,...
I am having trouble with label reference in fixtures...
I have two fixtures like this :
### cars.yml
one:
name: Ferari
two:
name: Volvo
### drivers.yml
one:
name: Stall
car: Ferari
'Drivers' table have a 'belongs_to' clause to the 'cars' table, vice
versa with 'has_many'
Evertime i am running my test, and access the 'drivers(:one).car', I
always get nil result.
Can some one tell me where my mistake?
Thanks in advance,
Hi,...
I am having trouble with label reference in fixtures...
I have two fixtures like this :
### cars.yml
one:
name: Ferari
two:
name: Volvo
### drivers.yml
one:
name: Stall
car: Ferari
'Drivers' table have a 'belongs_to' clause to the 'cars' table, vice
versa with 'has_many'
That should be car: one - You reference the fixture label, not any of
the data inside it.
Fred
Hi,...
I am having trouble with label reference in fixtures...
I have two fixtures like this :
### cars.yml
one:
name: Ferari
This should be
Ferari:
name: Ferari
two:
name: Volvo
### drivers.yml
one:
name: Stall
car: Ferari
The Ferari here refers to Ferari: above, not to the name field, which
is a column in the db. They need not be the same.
Colin
And I'd recommend making the 'ids' more intention revealing
### cars.yml
luigis_car:
name: Ferari
svens_car:
name: Volvo
### drivers.yml
luigi:
name: Stall
car: luigis_car