removes poll-booth direct association
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
class Poll < ActiveRecord::Base
|
||||
has_many :booths
|
||||
has_many :voters, through: :booths, class_name: "Poll::Voter"
|
||||
has_many :officers, through: :booths, class_name: "Poll::Officer"
|
||||
has_many :questions
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
class Poll
|
||||
class Booth < ActiveRecord::Base
|
||||
belongs_to :poll
|
||||
has_many :voters
|
||||
has_many :officing_booths, dependent: :destroy
|
||||
has_many :officers, through: :officing_booths
|
||||
|
||||
5
db/migrate/20161130122604_remove_poll_id_from_booth.rb
Normal file
5
db/migrate/20161130122604_remove_poll_id_from_booth.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class RemovePollIdFromBooth < ActiveRecord::Migration
|
||||
def change
|
||||
remove_column :poll_booths, :poll_id, :integer
|
||||
end
|
||||
end
|
||||
@@ -11,7 +11,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20161129011737) do
|
||||
ActiveRecord::Schema.define(version: 20161130122604) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
@@ -279,9 +279,8 @@ ActiveRecord::Schema.define(version: 20161129011737) do
|
||||
add_index "organizations", ["user_id"], name: "index_organizations_on_user_id", using: :btree
|
||||
|
||||
create_table "poll_booths", force: :cascade do |t|
|
||||
t.string "name"
|
||||
t.integer "poll_id"
|
||||
t.string "location"
|
||||
t.string "name"
|
||||
t.string "location"
|
||||
end
|
||||
|
||||
create_table "poll_officers", force: :cascade do |t|
|
||||
|
||||
Reference in New Issue
Block a user