• RSS
  • Delicious
  • Digg
  • Facebook
  • Twitter
  • Linkedin
  • Youtube

ActiveRecord after_commit hook

Most developers use ActiveRecord callbacks after_create/after_update/after_destroy to generate background job, expire cache, etc., but they don’t realize these callbacks are still wrapped in database transaction, they probably got unexpected results like the app queued a job but the record is not created/updated(transaction rolled back). For such situations after_commit callback should be used. after_commit is introduced from rails 3, if you  [ Read More ]

Continue

RoR doesn’t support foreign keys in DB migrations.This gem(goo.gl/xpoVt)adds foreign keys support in DB migrations. #ROR #GEM — Akhil Bansal (@bansalakhil) August 21, 2012

Continue

Using attachment_fu with S3 to save and serve data? Set cache-control headers by applying this patch to improve site performance and save some money: http://www.gozuus.com/blog/2009/03/caching-images-using-attachment_fu-and-amazon-s3/ If using PaperClip then add headers by adding: Find more info about paperclip s3 options here: http://rubydoc.info/gems/paperclip/Paperclip/Storage/S3

Continue

Asset Pipeline has been extracted a...

The asset pipeline which was introduced in Rails 3.1, has ...

ClientSideValidations: Add/Map mode...

#/status/256699237230845952

Action and Page caching has been ex...

With the commit c82cf81f00f Action and Page caching has been extracted ...

turbo-sprockets-rails3: Speeds up ...

#/status/253420357841723393

EdgeRails: ActiveRecord::SessionSto...

With the commit 3324e28804 ActiveRecord::SessionStore is extracted out of Rails into ...

Asset Pipeline has been extracted a...

The asset pipeline which was introduced in Rails 3.1, has ...

ClientSideValidations: Add/Map mode...

#/status/256699237230845952

Action and Page caching has been ex...

With the commit c82cf81f00f Action and Page caching has been extracted ...

turbo-sprockets-rails3: Speeds up ...

#/status/253420357841723393

EdgeRails: ActiveRecord::SessionSto...

With the commit 3324e28804 ActiveRecord::SessionStore is extracted out of Rails into ...