A software engineer, a drawer, a day dreamer. I extremely think there’s no magic on this world, but every night, I still imagine being a supper hero :3
We have lots of tests on browser in TINYpulse and more than 10 releases per day. So test execution speed is such a pain as we require all test passed before release, every seconds are counted. We keep optimizing…
In Rails world, there’s lots of time, we see code like this:
if Rails.env.production? # Do some dangerous stuffselse # Do less dangerousend
Mostly, when app interact with 3rd party services. Like, send to different…
Yesterday, we release a simple function, which need to add a text column to the most used table in TINYpulse Engage. We checked on test environment that it just took ~2 seconds to finish whole rake db:migrate task. Sound cool, but when goes production, it stuck.
rake db:migrate
tl;dr
If you write a gem, and want to use Rails.application config/method in gem initialization. Inherit ::Rails::Railtie class, hook into config.after_initialize. Put any Rails.application call into this hook to initialize your gem.