diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index ef148ae..f43a5c5 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -171,8 +171,6 @@ @project = Project.find(params[:id]) authorize @project -puts project_params - if user_signed_in? && @project.editable_by(current_user.id) then if @project.update_attributes(project_params) respond_to do |format| diff --git a/db/migrate/20170103221846_add_indexes_for_is_test_and_is_public_to_projects.rb b/db/migrate/20170103221846_add_indexes_for_is_test_and_is_public_to_projects.rb new file mode 100644 index 0000000..1768ab2 --- /dev/null +++ b/db/migrate/20170103221846_add_indexes_for_is_test_and_is_public_to_projects.rb @@ -0,0 +1,5 @@ +class AddIndexesForIsTestAndIsPublicToProjects < ActiveRecord::Migration + def change + add_index :projects, [:id, :is_test, :is_public] + end +end diff --git a/db/schema.rb b/db/schema.rb index b40c240..e88d56e 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: 20170103171414) do +ActiveRecord::Schema.define(version: 20170103221846) do create_table "answers", force: :cascade do |t| t.text "text", limit: 65535 @@ -255,6 +255,7 @@ t.boolean "is_public", default: false end + add_index "projects", ["id", "is_test", "is_public"], name: "index_projects_on_id_and_is_test_and_is_public", using: :btree add_index "projects", ["slug"], name: "index_projects_on_slug", unique: true, using: :btree create_table "question_formats", force: :cascade do |t|