4 karma · joined May 4, 2022 (4y ago) · 3 submissions
comment 1y ago · link · parent
upsert_all[1] is available to update a batch of records in a single write that does not invoke model callbacks.
activerecord-import[2] is also very nice gem that provides a great api for working with batches of records.
It can be as simple as extracting your callback logic and a method (def self.batch_update) and running your callback logic after the upsert.
[1] https://api.rubyonrails.org/classes/ActiveRecord/Relation.ht... [2] https://github.com/zdennis/activerecord-import
comment 2y ago · link · parent
comment 4y ago · link · parent
If you just want to use Vue for your rendering layer, you can can do that using a very minimal partial that renders the root element and loads the JS to mount the component. This example should get you started (Vue 2 syntax):
https://gist.github.com/yourboyblue/834aac9c427a97037dd49694...