Merge pull request #145 from openHPI/add_times_featured_to_rfc

add times_featured to rfc
This commit is contained in:
rteusner
2018-02-09 17:17:21 +01:00
committed by GitHub
3 changed files with 10 additions and 1 deletions

View File

@ -416,6 +416,9 @@ class ExercisesController < ApplicationController
flash[:notice] = I18n.t('exercises.submit.full_score_redirect_to_rfc')
flash.keep(:notice)
# increase counter 'times_featured' in rfc
rfc.increment!(:times_featured)
respond_to do |format|
format.html {redirect_to(rfc)}
format.json {render(json: {redirect: url_for(rfc)})}

View File

@ -0,0 +1,5 @@
class AddTimesFeaturedToRequestForComments < ActiveRecord::Migration
def change
add_column :request_for_comments, :times_featured, :integer, default: 0
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: 20180130172021) do
ActiveRecord::Schema.define(version: 20180202132034) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -281,6 +281,7 @@ ActiveRecord::Schema.define(version: 20180130172021) do
t.integer "submission_id"
t.text "thank_you_note"
t.boolean "full_score_reached", default: false
t.integer "times_featured", default: 0
end
create_table "searches", force: :cascade do |t|