31 Jan '14, 2pm

"after_* callbacks on Rails models seem to have some of the most tightly-coupled code"

ActiveRecord, Caching, and the Single Responsibility Principle Josh Clayton August 19, 2011 rails good code I was working on a messaging system earlier this week and noticed a pretty tight coupling between two classes. class Message < ActiveRecord::Base belongs_to :author, :class_name => 'User' belongs_to :conversation, :touch => true after_create :author_reads_conversation after_save :update_answered after_save :update_last_student_posted_at after_save :update_last_post_at after_save :update_participants after_save :update_messages_count # ... private def update_answered if conversation.kind == Conversation::QUESTION || conversation.kind == Conversation::ASSIGNMENT if author.instructor? conversation.update_attribute(:answered, true) else conversation.update_attribute(:answered, false) end end end def update_last_post_at conversation.update_attribute(:last_post_at, self.cr...

Full article: http://robots.thoughtbot.com/activerecord-caching-and-the...

Tweets

Culling ActiveRecord Callbacks

rubyflow.com 31 Jan '14, 10pm

Culling ActiveRecord Callbacks Posted by patricksroberts on January 31, 2014 — 0 comments I wrote a blog post on how I've ...

Single Page Websites & SEO

Single Page Websites & SEO

searchengineland.com 31 Jan '14, 2pm

Single page websites are quite popular right now; I see more and more each week on sites like The Latest and Product Hunt ...

Had an independent team review your Ruby on Rails application lately? We love to perform code reviews and audits.

Had an independent team review your Ruby on Rai...

planetargon.com 29 Jan '14, 2pm

Our extensive experience working with Ruby on Rails over the past eight years has provided us with the opportunity to revi...

I'll admit it. I've been using Rails for years ...

guides.rubyonrails.org 30 Jan '14, 3pm

method does the heavy lifting of rendering your application's content for use by a browser. There are a variety of ways to...

Reading Rails - Errors and Validators

rubyflow.com 30 Jan '14, 4pm

Reading Rails - Errors and Validators Posted by netghost on January 30, 2014 — 0 comments Are you a curious developer? I s...