# Rails 2.1 after upgrade from 1.2.6 have fixture weirdness

**URL:** <https://www.ruby-forum.com/t/rails-2-1-after-upgrade-from-1-2-6-have-fixture-weirdness/145345>\
**Category:** Rails\
**Created:** [August 8, 2008, 9:39am UTC](https://www.ruby-forum.com/t/rails-2-1-after-upgrade-from-1-2-6-have-fixture-weirdness/145345 "2008-08-08T09:39:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rooster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/71c47a/32.png) [@rooster](https://www.ruby-forum.com/u/rooster)\
**Post date:** [August 8, 2008, 9:39am UTC](https://www.ruby-forum.com/t/rails-2-1-after-upgrade-from-1-2-6-have-fixture-weirdness/145345/1 "2008-08-08T09:39:38Z")

</div>

Hi,

I am seeing some strangeness with fixture loading in our suite of specs.

1st up any join table fixture or namespaced model causes an error in  
test.log

example

Unable to load advertising\_channels\_position\_profile, underlying  
cause no such file to load – advertising\_channels\_position\_profile /  
Library/Ruby/Site/1.8/rubygems/custom\_require.rb:27:in  
`gem\_original\_require’/

it seems to looking for a model corresponding with a fixture, since  
this is a join table fixture there is no model

Further weirdness is when using transactional fixtures  
i get loads of errors like “Can’t find User with ID=1” when i know the  
record is in the db  
i can output the db contents along side it.

all these errors dissapear with transactional fixtures turned off

a majority of the specs i have looked at pass individually but error  
when run by autotest or verify with spec rcov

Anyone got any ideas

rails 2.1  
rspec 1.1.4  
ruby 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0]

Cheers  
Steven

/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/  
Steven H.  
Programmer, Web D., IT Consultant  
Composer, Producer, Performer, DJ  
/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/

---

<div class="post-metadata">

**Author:** ![rooster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/71c47a/32.png) [@rooster](https://www.ruby-forum.com/u/rooster)\
**Post date:** [August 21, 2008, 6:49pm UTC](https://www.ruby-forum.com/t/rails-2-1-after-upgrade-from-1-2-6-have-fixture-weirdness/145345/2 "2008-08-21T18:49:03Z")

</div>

I am seeing what I think is the same issue - but slightly different  
characteristics. My site was started from scratch in Rails 2.1 (no  
upgrade). The ‘missing file’ appears to me to be because the whatever  
infers association names isn’t pluralizing both halves. There is no  
file roles\_user.yml because it is roles\_users.yml.

Other differences:  
Changing transactional fixtures to ‘false’ do not fix this for me  
And I am using Enterprise Ruby 1.8.6-20080709

Unable to load roles\_user, underlying cause no such file to load –  
roles\_user

/software/stow/ruby-enterprise-1.8.6-20080709/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`gem_original_require' /software/stow/ruby-enterprise-1.8.6-20080709/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in`require’  
/software/stow/ruby-enterprise-1.8.6-20080709/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active\_support/dependencie  
s.rb:509:in `require' /software/stow/ruby-enterprise-1.8.6-20080709/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencie\ s.rb:354:in`new\_constants\_in’  
/software/stow/ruby-enterprise-1.8.6-20080709/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active\_support/dependencie  
s.rb:509:in `require' /software/stow/ruby-enterprise-1.8.6-20080709/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencie\ s.rb:101:in`require\_or\_load’  
/software/stow/ruby-enterprise-1.8.6-20080709/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active\_support/dependencie  
s.rb:60:in `depend_on' /software/stow/ruby-enterprise-1.8.6-20080709/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencie\ s.rb:456:in`require\_dependency’  
/software/stow/ruby-enterprise-1.8.6-20080709/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active\_record/fixtures.rb:8  
55:in `try_to_load_dependency' /software/stow/ruby-enterprise-1.8.6-20080709/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/fixtures.rb:8\ 70:in`require\_fixture\_classes’  
/software/stow/ruby-enterprise-1.8.6-20080709/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active\_record/fixtures.rb:8  
67:in `each' /software/stow/ruby-enterprise-1.8.6-20080709/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/fixtures.rb:8\ 67:in`require\_fixture\_classes’  
/software/stow/ruby-enterprise-1.8.6-20080709/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active\_record/fixtures.rb:8  
50:in `fixtures' ./test/integration/../test_helper.rb:41 ./test/integration/page_permissions_test.rb:1:in`require’  
./test/integration/page\_permissions\_test.rb:1  
/software/stow/ruby-enterprise-1.8.6-20080709/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake/rake\_test\_loader.rb:5:in  
`load' /software/stow/ruby-enterprise-1.8.6-20080709/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake/rake_test_loader.rb:5 /software/stow/ruby-enterprise-1.8.6-20080709/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake/rake_test_loader.rb:5:in`each’  
/software/stow/ruby-enterprise-1.8.6-20080709/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake/rake\_test\_loader.rb:5

---

<div class="post-metadata">

**Author:** ![rooster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/71c47a/32.png) [@rooster](https://www.ruby-forum.com/u/rooster)\
**Post date:** [August 21, 2008, 7:13pm UTC](https://www.ruby-forum.com/t/rails-2-1-after-upgrade-from-1-2-6-have-fixture-weirdness/145345/3 "2008-08-21T19:13:42Z")

</div>

On 21 Aug 2008, at 17:48, Cynthia K. wrote:

> I am seeing what I think is the same issue - but slightly different  
> characteristics. My site was started from scratch in Rails 2.1 (no  
> upgrade). The ‘missing file’ appears to me to be because the whatever  
> infers association names isn’t pluralizing both halves. There is no  
> file roles\_user.yml because it is roles\_users.yml.

It sounds like it’s spotting your roles\_users.yml fixture and trying  
to load the matching class (RolesUser from roles\_user). If that’s just  
a habtm then there is no such model (and that fixture file isn’t  
actually necessary if you use the foxy fixtures stuff in rails 2.0 &  
above)

Fred
