diff --git a/app/models/poll/voter.rb b/app/models/poll/voter.rb index c55bc497c..8b0202aee 100644 --- a/app/models/poll/voter.rb +++ b/app/models/poll/voter.rb @@ -7,8 +7,6 @@ class Poll validate :in_census validate :has_not_voted - before_create :assign_poll - def in_census errors.add(:document_number, :not_in_census) unless census_api_response.valid? end @@ -29,9 +27,5 @@ class Poll @census.name end - def assign_poll - poll_id = booth_assignment.poll_id - end - end end \ No newline at end of file diff --git a/db/migrate/20161207181001_remove_poll_id_from_voter.rb b/db/migrate/20161207181001_remove_poll_id_from_voter.rb new file mode 100644 index 000000000..5a7012460 --- /dev/null +++ b/db/migrate/20161207181001_remove_poll_id_from_voter.rb @@ -0,0 +1,5 @@ +class RemovePollIdFromVoter < ActiveRecord::Migration + def change + remove_column :poll_voters, :poll_id, :integer + end +end diff --git a/db/schema.rb b/db/schema.rb index 3337764e6..d70027258 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20161206132126) do +ActiveRecord::Schema.define(version: 20161207181001) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -340,7 +340,6 @@ ActiveRecord::Schema.define(version: 20161206132126) do t.string "document_number" t.string "document_type" t.integer "booth_assignment_id", null: false - t.integer "poll_id", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false end