Select Page

Running Rake Tasks with Cron and File Locks

Rake tasks within Ruby on Rails are compelling. It doesn’t matter if you need to do some maintenance, cleanup or complex data processing, rake tasks will emerge in your system as it is becoming bigger and more complex. More importantly, you certainly...

Action Cable on specific page within Ruby on Rails

Using page specific action cable functionality within ruby on rails comes in very handy sometimes. It allows you to target given functionality to specific pages and controllers. Furthermore, it reduces the number of open web sockets, which again reduces your server...

Set default values for has_one association

Sometimes you simply want to set some default values for an associated model within ActiveRecord without thinking too much of creating possible side effects when overriding methods like build_association or add model callbacks. The following example demonstrates the...