[openstreetmap/openstreetmap-website] Use activerecord-import for bulk importing tracepoint records (#2131)
Andy Allan
notifications at github.com
Wed Mar 13 13:53:58 UTC 2019
gravitystorm commented on this pull request.
> end
+ # Run the before_save and before_create callbacks, and then import them in bulk with activerecord-import
+ tracepoints.each do |tp|
+ tp.run_callbacks(:save) { false }
+ tp.run_callbacks(:create) { false }
+ end
+ Tracepoint.import(tracepoints)
Good point, but I don't know, tbh.
I can look at doing something clever to yield the points in batches too.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/2131#discussion_r265136221
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20190313/135734c5/attachment.html>
More information about the rails-dev
mailing list