RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

Submit a post

You can use basic HTML markup (e.g. <a>) or Markdown.
Note that your post may be edited to suit the format of the site.

As you are not logged in, you will be
directed via GitHub to signup or sign in

Post Preview

Note: Only the first pargraph is shown on the front page and overly long paragraphs may be broken up.

Trip: concurrent tracer built on Thread#set_trace_func.

trip is a concurrent tracer for the ruby programming language. It yields control between two threads, most likely the main thread and a thread that trip creates. It is implemented in pure ruby(no C) and with the help of “Thread#set_trace_func”. It can be useful when building developer tools like a debugger or if you want to step through code progmatically at runtime.

Cron Jobs and Rails

We wrote up a new tutorial on how to run Cron jobs with your Rails apps. We talked about use Cron to run rake tasks, Rails runners and the Whenever gem, and some alternatives such as Sidekiq/Sidetiq and the Heroku Scheduler.  [more inside]

Recalculate counter cache columns in Rails

Rails has this great feature called counter_cache. When you have a has_many/belongs_to relationship between two models, it basically lets you say that you want to save the number of associated objects on the has_many side. So if you have Post has many Comments, you can do post#size and no SQL query is executed, Rails simply just looks at the comments_count field of the post. [more inside]

Loading older posts