def self.find_for(options = {})
    scope = scoped
    scope = scope.where(:hook => options[:hook].to_s)  if options[:hook]
...

Ruby ActiveRecord query construc...

by https://www.google.com/accounts/o8/id?id=AItOawmLF7gR3CIpZoZXbwO7fiD2QWYltD3lwpM, December 23, 2010 15:27, 1 refactoring, tagged with rails, sql, activerecord, rails3, arel

Rails 3.0.3

This method ...

55502f40dc8b7c769880b10874abc9d0 Talk
class Topic < ActiveRecord::Base

  # Finds most active users in the topic
...

Ruby most active users through r...

by edgarjs, November 05, 2010 20:03, 1 refactoring, tagged with associations, rails3, arel, finders

There are topics, each topi...

380f2ee82510287050b118947e8526dd Talk