Skip to content

Instantly share code, notes, and snippets.

@mattjstar
Last active August 29, 2015 14:05
Show Gist options
  • Save mattjstar/a9e3ccfec3b7f2d14dae to your computer and use it in GitHub Desktop.
Save mattjstar/a9e3ccfec3b7f2d14dae to your computer and use it in GitHub Desktop.
Daniel Data Model
class Item < ActiveRecord::Base
has_many :user_group_items
has_many :user_groups, through: :user_group_items
end
class UserGroup < ActiveRecord::Base
has_many :user_group_items
has_many :items, through: :user_group_items
end
class UserGroupItems < ActiveRecord::Base
belongs_to :user_group
belongs_to :item
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment