# Rails fixtures load not working as stated (2.3.4)

**URL:** <https://www.ruby-forum.com/t/rails-fixtures-load-not-working-as-stated-2-3-4/176923>\
**Category:** Rails\
**Created:** [October 8, 2009, 12:21pm UTC](https://www.ruby-forum.com/t/rails-fixtures-load-not-working-as-stated-2-3-4/176923 "2009-10-08T12:21:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [October 8, 2009, 12:21pm UTC](https://www.ruby-forum.com/t/rails-fixtures-load-not-working-as-stated-2-3-4/176923/1 "2009-10-08T12:21:12Z")

</div>

as staed in the API, I am loading fixtures into a table :

rake db:fixtures:load FIXTURES=ecourses without specifying the id in  
a simple has\_many/belongs\_to association, and I get an ‘unknow  
column’ error for the foreign\_key…  
if I change the FK to a label interpolation, then I got it running  
well…

I am using the following tset code  
:  
Models--------------  
class Epath \< ActiveRecord::Base  
has\_many :ecourses  
end

class Ecourse \< ActiveRecord::Base  
belongs\_to :epath  
end

Fixtures---------------

# epaths

complexPath:  
name: Complex One

# ecourses.yml

curabitur:  
name: Curabitur  
epath: complexPath

error : Mysql::Error: Unknown column ‘epath’ in ‘field list’ : INSERT  
INTO `ecourses` (`epath`,…

BUT if I modify the Fixtures

# ecourses.yml

curabitur:  
name: Curabitur  
epath\_id: \<%= Fixtures.identify(:complexPath) %\>

then I got it done …

what’s wrong in my code ?

tfyh

erwin
