Skip to content

Instantly share code, notes, and snippets.

@sirn
Created July 19, 2013 13:49
Show Gist options
  • Save sirn/6039229 to your computer and use it in GitHub Desktop.
Save sirn/6039229 to your computer and use it in GitHub Desktop.
class Foo < ActiveRecord::Base
has_many :bars, :include => [:user]
end
class Bar < ActiveRecord::Base
belongs_to :foo
belongs_to :user
def self.some_complex_count
joins(:somewhere_else).joins(:someother_table).where do
# Squeel
end.count
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment