Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Ruby JavaScript
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
commentator
README

README

Railscasts Episode #181: Include vs Joins

http://railscasts.com/episodes/181

script/console

  c = Comment.all(:joins => :user, :conditions => { :users => { :admin => true } })
  c.first.users
  c = Comment.all(:include => :user, :conditions => { :users => { :admin => true } })
  c.first.users
  User.all(:joins => :comments, :select => "users.*, count(comments.id) as comments_count", :group => "users.id")
  g = Group.first
  Comment.all(:joins => {:user => :memberships}, :conditions => { :memberships => { :group_id => g.id } })
Something went wrong with that request. Please try again.