Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- has_many :organizations, :through => :jobs
- has_many :jobs, dependent: :destroy
- has_many :users, :through => :jobs
- has_many :jobs, dependent: :destroy
- belongs_to :organization, :foreign_key => :organization_id
- belongs_to :user, :foreign_key => :user_id
- includes(:jobs).where(jobs: { :user_id => current_user.id, :role => ["management", "admin"] }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement