mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-14 04:04:03 +00:00
Replaced find_all_by through find_by
Find_by_all is removed in Rails 4.1
This commit is contained in:
parent
ee20ecce2f
commit
fbda757e70
8 changed files with 19 additions and 19 deletions
|
|
@ -2,19 +2,19 @@ class Admin::QuestionsController < ApplicationController
|
|||
before_filter :verify_organizer
|
||||
|
||||
def index
|
||||
@conference = Conference.find_all_by_short_title(params[:conference_id]).first
|
||||
@conference = Conference.find_by(short_title: params[:conference_id])
|
||||
@questions = Question.where(:global => true).all | Question.where(:conference_id => @conference.id)
|
||||
@questions_conference = @conference.questions
|
||||
@new_question = @conference.questions.new
|
||||
end
|
||||
|
||||
def new
|
||||
@conference = Conference.find_all_by_short_title(params[:conference_id]).first
|
||||
@conference = Conference.find_by(short_title: params[:conference_id])
|
||||
@new_question = @conference.questions.new
|
||||
end
|
||||
|
||||
def create
|
||||
@conference = Conference.find_all_by_short_title(params[:conference_id]).first
|
||||
@conference = Conference.find_by(short_title: params[:conference_id])
|
||||
@question = @conference.questions.new(params[:question])
|
||||
@question.conference_id = @conference.id
|
||||
|
||||
|
|
@ -30,7 +30,7 @@ class Admin::QuestionsController < ApplicationController
|
|||
|
||||
# GET questions/1/edit
|
||||
def edit
|
||||
@conference = Conference.find_all_by_short_title(params[:conference_id]).first
|
||||
@conference = Conference.find_by(short_title: params[:conference_id])
|
||||
@question = Question.find(params[:id])
|
||||
|
||||
if @question.global == true && !has_role?(current_user, "Admin")
|
||||
|
|
@ -41,7 +41,7 @@ class Admin::QuestionsController < ApplicationController
|
|||
# PUT questions/1
|
||||
def update
|
||||
|
||||
@conference = Conference.find_all_by_short_title(params[:conference_id]).first
|
||||
@conference = Conference.find_by(short_title: params[:conference_id])
|
||||
@question = Question.find(params[:id])
|
||||
|
||||
if @question.update_attributes(params[:question])
|
||||
|
|
@ -53,7 +53,7 @@ class Admin::QuestionsController < ApplicationController
|
|||
|
||||
# Update questions used for the conference
|
||||
def update_conference
|
||||
@conference = Conference.find_all_by_short_title(params[:conference_id]).first
|
||||
@conference = Conference.find_by(short_title: params[:conference_id])
|
||||
|
||||
if @conference.update_attributes(params[:conference])
|
||||
redirect_to(admin_conference_questions_path(:conference_id => @conference.short_title), :notice => "Questions for #{@conference.short_title} successfully updated.")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue