2009年9月17日星期四

My bookmarks from Diigo 09/17/2009

  • tags: ruby, rails, Active Record, Callbacks

    • 17 Observers


      Observers are similar to callbacks, but with important differences. Whereas callbacks can pollute a model with code that isn’t directly related to its purpose, observers allow you to add the same functionality outside of a model. For example, it could be argued that a User model should not include code to send registration confirmation emails. Whenever you use callbacks with code that isn’t directly related to your model, you may want to consider creating an observer instead.

  • tags: ruby, rails, guide


Posted from Diigo. The rest of my favorite links are here.

没有评论: