Importing from CSV

28 views
Skip to first unread message

matt macri

unread,
Mar 28, 2013, 6:47:08 PM3/28/13
to rgeo-...@googlegroups.com
Hey guys!

I'm attempting to map all public library locations and relative information for BC, Canada. For shits and gigs of course.

I got my migration all set up and the database is working I was able to map a faux library in the middle of no where without problems and call it back up using irb. Now I'm trying to import my library locations from csv using a rake task called import here is the gist of my task: https://gist.github.com/mgmacri/5249819 The error returned is undefined method `create' for []:Array

I've never written a task before but if anyone can help I'd really appreciate it! 

Robert Pyke

unread,
Mar 28, 2013, 7:13:49 PM3/28/13
to rgeo-...@googlegroups.com

The thing you're calling create on should be your model. I'm guessing that it should be something like Library.create, rather than import.create. If you can link to your repo, or show the code of your model, I might be able to help more.

Cheers,
Robert

--
You received this message because you are subscribed to the Google Groups "RGeo-Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rgeo-users+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

matt macri

unread,
Apr 14, 2013, 4:41:34 AM4/14/13
to rgeo-...@googlegroups.com
Here's the rake task I ended up writing to solve the issue :) Thanks for you reply! 


Reply all
Reply to author
Forward
0 new messages