adds poll/booth_assigments
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
class Poll < ActiveRecord::Base
|
||||
has_many :booth_assigments
|
||||
has_many :booths, through: :booth_assigments, class_name: "Poll::BoothAssignment"
|
||||
has_many :voters, through: :booths, class_name: "Poll::Voter"
|
||||
has_many :officers, through: :booths, class_name: "Poll::Officer"
|
||||
has_many :questions
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
class Poll
|
||||
class Booth < ActiveRecord::Base
|
||||
has_many :booth_assigments
|
||||
has_many :polls, through: :booth_assigments
|
||||
has_many :voters
|
||||
has_many :officing_booths, dependent: :destroy
|
||||
has_many :officers, through: :officing_booths
|
||||
|
||||
6
app/models/poll/booth_assignment.rb
Normal file
6
app/models/poll/booth_assignment.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
class Poll
|
||||
class BoothAssignment < ActiveRecord::Base
|
||||
belongs_to :booth
|
||||
belongs_to :poll
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user