Quick question on fixtures. I know fixtures are primarily for unit
testing but I was thinking of using them to help me with development. I
need some realistic data so with the ERb templated fixtures it seems
like I could generate that and insert it in my development database.
That would give me real data to work with (instead of just a few records
I have manually inserted in each table). But I have two questions on
Is there an easy way that I can say “load these fixtures into this
database” or do I need to look at the Fixtures API and write a script do
this (just wondering if there is already a rake task or something that
will do this).
When it loads the fixture does it create a instance of that object
then call save or do a straight insert. The reason I was wondering is
because some fields are generated by ActiveRecord (updated_on,
nested_set left and right columns, etc) and it seems that this data
wouldn’t be generated. I would prefer not to have to type this stuff
into the YAML file myself.
Would it be better just to write a console script that uses ActiveRecord
to create my test data?