Skip to content

CSV fixtures striping needed whitespace #2137

Closed
pivotal-awesome-couches opened this Issue Jul 18, 2011 · 5 comments

3 participants

@pivotal-awesome-couches

This line is stripping whitespace we need for our test data. It is effecting our Rspec tests.

https://github.com/rails/rails/blob/3-0-9/activerecord/lib/active_record/fixtures.rb#L745

Was there a reasoning for this?

@franckverrot

I think strip is just there to sanitize the input. I'm curious about your use case now :)

@pivotal-awesome-couches

We have a string providing day information in a format "SMTWTFS". Each day is represented with the character in the string position, if the day is not active it is replace with a space, so for Monday and Friday we have " M F ". We are working with a rather large dataset, so changing the format of the data wasn't an option. We just kept running into a problem where Sunday was active with Monday, etc.

@franckverrot

strip-ing in https://github.com/rails/rails/blob/3-0-9/activerecord/lib/active_record/fixtures.rb#L745 was added a long time ago. So is it a regression (and if so, compared to what version?) or are you effectively using CSV fixtures for the first time?

@pivotal-awesome-couches

This was started on a greenfield project, so using CSV fixtures for the first time. We started directly on Rails 3.0.7.

@franckverrot

CSV fixtures have been deprecated and support for them removed in 3-1.

@lsylvester lsylvester pushed a commit to lsylvester/rails that referenced this issue Jul 27, 2011
Neeraj Singh making rake:migrate VERSION=0 a noop called in succession. [#2137 sta…
…te:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
f4d174b
@vijaydev vijaydev closed this Nov 22, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.