Hello again!
ok, i have some initial migration code which sets up my apps schema. i
have a
few tables that get initialized with data in this migration where i have
the
table data in yaml format in test/fixtures. i use db:fixtures:load
FIXTURES=countries,provstates,employees to initialize these tables…
here’s the wrinkle: employees when it gets loaded should only contain
the admin
account (so i can access the app after running the migration)… however
employees.yml also contains some other accounts of various priveleges
for
testing purposes. what i want to do is load the fixture into the db, but
delete
all the records except for the admin account… if i do:
cmd = ‘rake db:fixtures:load FIXTURES=countries,provstates,employees’
system cmd
Employee.delete_all “username != ‘admin’”
I get an error on the line that uses the Employee model. i tried a few
diff
variations of require’ing the model, but haven’t had any luck…
my short term solution was to just have the admin account in the
fixture, but
now when i want to test i don’t have those other accounts to test with…
i’m pretty sure i could use ActiveRecord::Base to do this with a little
bit of
digging, but if i could use the model directly it would be much
simpler…
thanks a bunch !
stuart