Title / Description
Code lambda { |objs| { :select => "domain_objects.*, count(links.from_id) AS object_count", :conditions => objs.inject("TRUE") { |str,obj| str + " OR ( links.object_value.id = '#{obj.id}' AND links.object_value_type = '#{obj.class}' )" }, :joins => "INNER JOIN links ON links.from_id = domain_objects.id", :group => "links.from_id,links.object_value_type HAVING object_count >= #{objs.to_a.size}" } }
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code