removes poll_id from voter

YAGNI
This commit is contained in:
Juanjo Bazán
2016-12-07 19:11:43 +01:00
parent 21c9f2c44b
commit bdf16395d3
3 changed files with 6 additions and 8 deletions

View File

@@ -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

View File

@@ -0,0 +1,5 @@
class RemovePollIdFromVoter < ActiveRecord::Migration
def change
remove_column :poll_voters, :poll_id, :integer
end
end

View File

@@ -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