The opposite of this question: Run initializer only for Rake tasks
Is it possible to exclude an initializer during rake tasks?
Thanks.
You could wrap your initializer in a block like this:
unless ( File.basename($0) == 'rake')
# Initializer code
end
Straight from this answer: https://stackoverflow.com/a/24159563/1867481
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With