Guest User

Untitled

a guest
Jul 12th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. class User < ActiveRecord::Base
  2. has_one :preferences
  3. has_many :projects
  4. has_many :branches
  5. has_many :documents
  6. has_many :annotations
  7. has_many :comments
  8. has_many :micro_messages
  9. has_many :micro_message_project_subscriptions
  10. has_many :subscribed_projects, :through => :micro_message_project_subscriptions, :source => :project
  11. end
  12.  
  13.  
  14.  
  15. class Project < ActiveRecord::Base
  16. belongs_to :user
  17. has_many :branches
  18. has_many :micro_messages
  19. has_many :micro_message_project_subscriptions
  20. has_many :subscribed_users, :through => :micro_message_project_subscriptions, :source => :user
  21. end
  22.  
  23.  
  24.  
  25.  
  26. class MicroMessageProjectSubscriptions < ActiveRecord::Base
  27. belongs_to :user
  28. belongs_to :project
  29. end
Add Comment
Please, Sign In to add comment