Skip to content
This repository has been archived by the owner on Jun 30, 2018. It is now read-only.

Temporarily Disable Callbacks #950

Closed
rdetert opened this issue Mar 13, 2014 · 2 comments
Closed

Temporarily Disable Callbacks #950

rdetert opened this issue Mar 13, 2014 · 2 comments
Labels

Comments

@rdetert
Copy link

rdetert commented Mar 13, 2014

I'm performing an operation which require me to iterate though every item in the table to generate slugs on save by running Model.find_each(&:save)

It is pretty quick except for the the Elasticsearch callbacks. Is there any way to disable these callbacks on the fly?

@karmi
Copy link
Owner

karmi commented Apr 12, 2014

Hmm, I guess just "nuking" the callbacks by redefining them with define_method or class_eval or something like that...

@karmi karmi added the waiting label Apr 12, 2014
@rdetert
Copy link
Author

rdetert commented May 3, 2014

Fair enough. I think I may just run a cron job every hour to batch import new records.

@rdetert rdetert closed this as completed May 3, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants