Skip to content

Instantly share code, notes, and snippets.

@DCarper
Created February 15, 2011 21:09
Show Gist options
  • Select an option

  • Save DCarper/828247 to your computer and use it in GitHub Desktop.

Select an option

Save DCarper/828247 to your computer and use it in GitHub Desktop.
class Bracket < ActiveRecord::Base
has_many :memberships, :as => :app
end
class Membership < ActiveRecord::Base
belongs_to :user
belongs_to :app, :polymorphic => true
end
class User < ActiveRecord::Base
has_many :memberships
## i need
has_many :brackets, :through => :memberships
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment