Rails fixtures seem to be adding extra unexpected data?

You could turn on ActiveRecord logging (put ActiveRecord::Base. Logger = Logger. New(STDOUT) in your test/test_helper.

Rb file) Or, instead of using fixtures (which have gone the way of the dodo for most Rails developers) you could use something more reliable like Factories ( thoughtbot's factory_girl ) or seed_fu (if you have specific data that must be loaded).

You could turn on ActiveRecord logging (put ActiveRecord::Base. Logger = Logger. New(STDOUT) in your test/test_helper.

Rb file). Or, instead of using fixtures (which have gone the way of the dodo for most Rails developers) you could use something more reliable like Factories (thoughtbot's factory_girl) or seed_fu (if you have specific data that must be loaded).

I discovered what the problem was, although not the precise way to prevent it. I was placing ERB into the fixture CSV file, which was working fine, but due to the way it was being parsed and processed, it was causing blank lines to be placed into the resulting CSV output. Fixtures doesn't seem to handle that very well, and as a result it was inserting blank rows into the table.

I couldn't prevent the blank lines from being placed into the output CSV because for whatever reason, the doesn't work -- having the closing dash caused ERB parsing errors. Not sure why. In any case, the eventual workaround was to switch to YML instead of CSV.It tolerates the white space just fine, and no blank rows are being inserted into the table anymore.

As an aside, factory___girl seems potentially interesting, but the YML is now doing just fine so it may be overkill. There's not a huge benefit to using seed_fu I think.In this current case I'm testing reporting code so the data is very specific and needs to be structured in a certain way in order to verify output data for the reports.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions