default result sorting to quiz submission descending

completes #85
This commit is contained in:
Mark Moser
2016-12-04 16:41:07 -06:00
parent 73df3d1258
commit 9cf2aeb139
6 changed files with 28 additions and 7 deletions

View File

@ -0,0 +1,12 @@
# frozen_string_literal: true
class AddCompletedAt < ActiveRecord::Migration[5.0]
def change
add_column :candidates, :completed_at, :datetime, after: :completed
Candidate.reset_column_information
Candidate.where(completed: true).each do |candidate|
candidate.completed_at = candidate.updated_at
candidate.save
end
end
end

View File

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20161120175737) do
ActiveRecord::Schema.define(version: 20161204220527) do
create_table "answers", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
t.integer "candidate_id"
@ -32,6 +32,7 @@ ActiveRecord::Schema.define(version: 20161120175737) do
t.string "experience"
t.integer "recruiter_id"
t.boolean "completed"
t.datetime "completed_at"
t.boolean "reminded"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
@ -77,11 +78,11 @@ ActiveRecord::Schema.define(version: 20161120175737) do
create_table "reviewer_votes", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
t.integer "candidate_id"
t.integer "user_id"
t.integer "vote", default: 0, null: false
t.integer "veto", default: 0, null: false
t.integer "vote", default: 0, null: false
t.integer "veto", default: 0, null: false
t.datetime "last_reminded"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["candidate_id", "user_id"], name: "index_reviewer_votes_on_candidate_id_and_user_id", unique: true, using: :btree
end