RailsCasts Pro episodes are now free!

Learn more or hide this

Yuval Kordov's Profile

GitHub User: uberllama

Site: littleblimp.com

Comments by Yuval Kordov

Avatar

I have to agree with this. Ryan normally provides an amazing resource in Railscasts, but I find the raffler example too contrived to be useful. Especially for a pro cast.

Avatar

Interesting, as from watching this video it looked like the trackable objects had to be loaded.

The reason to use DJ is if you're writing the activity from a model/observer callback, to defer a few additional SQL calls required to populate the denormalized data. If you have everything you need at the time of writing, its unnecessary.

Avatar

Interesting timing, as I've been working on a couple different approaches for activity feeds this month. My current process goes like this:

  • Queue creation of activity record via a delayed process (DJ, etc)
  • In an Activity model before_create callback, retrieve the relevant objects, store references to them, but also denormalize the relevant bits (ex. post name, commenter name) into an hstore hash.

By doing the latter, there are no lookups required for the trackable objects when generating your activity feed. Its super fast. Activity streams can be generated purely with the denormalized data, but we have the trackable references in case we need them. Also, you don't lose the data (post name, etc) when an object is deleted, and can instead defer handling of clickthroughs to deleted objects.

Avatar

I've never had an issue using before_filter when setting time zone. Its local.

Avatar

Out of curiosity, how are you compiling your coffeescript from text mate? The rails gem doesn't include a coffee command line utility as far asI can tell, so I get an error when trying to run the coffee command from TM (not a path issue, as "which coffee" results in a blank). Did you install this separately? Any conflicts?