diff --git a/app/helpers/lti_helper.rb b/app/helpers/lti_helper.rb index f46974cd..433468a1 100644 --- a/app/helpers/lti_helper.rb +++ b/app/helpers/lti_helper.rb @@ -5,6 +5,6 @@ module LtiHelper lti_parameters = LtiParameter.where(consumers_id: consumer_id, external_users_id: external_user_id, exercises_id: exercise_id).lis_outcome_service_url? - !lti_parameters.nil? && lti_parameters.size > 0 + !lti_parameters.nil? && lti_parameters.present? end -end \ No newline at end of file +end diff --git a/db/migrate/20180823135317_add_index_for_testrun_submission_id.rb b/db/migrate/20180823135317_add_index_for_testrun_submission_id.rb new file mode 100644 index 00000000..d0511dc9 --- /dev/null +++ b/db/migrate/20180823135317_add_index_for_testrun_submission_id.rb @@ -0,0 +1,5 @@ +class AddIndexForTestrunSubmissionId < ActiveRecord::Migration + def change + add_index :testruns, :submission_id + end +end diff --git a/db/schema.rb b/db/schema.rb index 2646f080..2e1ec3cb 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: 20180815115351) do +ActiveRecord::Schema.define(version: 20180823135317) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -383,6 +383,8 @@ ActiveRecord::Schema.define(version: 20180815115351) do t.string "cause" end + add_index "testruns", ["submission_id"], name: "index_testruns_on_submission_id", using: :btree + create_table "user_exercise_feedbacks", force: :cascade do |t| t.integer "exercise_id", null: false t.integer "user_id", null: false