Skip to content

Instantly share code, notes, and snippets.

@emschwar
Created August 22, 2011 16:05
Show Gist options
  • Save emschwar/1162765 to your computer and use it in GitHub Desktop.
Save emschwar/1162765 to your computer and use it in GitHub Desktop.
class Foo < ActiveRecord::Base
has_many :bars, :include => :baz, :conditions => "bazes.active = 1"
has_many :bazes, :through => :bars
end
class Bar
belongs_to :foo
belongs_to :baz
end
clazz Baz
has_many :bars
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment