The opposite of this question: Run initializer only for Rake tasks
Is it possible to exclude an initializer during rake tasks?
Thanks.
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