Skip to content

v0.2.0 (June 15, 2023)

Latest
Compare
Choose a tag to compare
@stevepolitodesign stevepolitodesign released this 15 Jun 11:05
· 6 commits to main since this release
2726af8

Add option that allows stripping of whitespace for all values (#19)

csv_string = CSV.generate do |csv|
  csv << ["email_address  ", " passcode  "]
  csv << ["  george@vandelay_industries.com  ", "  bosco  "]
end

result = ArtVandelay::Import.new(:users, strip: true).csv(csv_string, attributes: {email_address: :email, passcode: :password})
# => #<ArtVandelay::Import::Result>

result.rows_accepted
# => [{:row=>["george@vandelay_industries.com", "bosco"], :id=>1}]