rubocop files update and auto correction

This commit is contained in:
raluka 2015-10-21 17:33:53 +02:00
parent 42e8bb11ea
commit 2a30b076b8
88 changed files with 519 additions and 452 deletions

View file

@ -73,12 +73,9 @@ module Admin
# Delete question and its answers
begin
Question.transaction do
@question.destroy
@question.answers.each do |a|
a.destroy
end
flash[:notice] = "Deleted question: #{@question.title} and its answers: #{@question.answers.map {|a| a.title}.join ','}"
@question.answers.each(&:destroy)
flash[:notice] = "Deleted question: #{@question.title} and its answers: #{@question.answers.map(&:title).join ','}"
end
rescue ActiveRecord::RecordInvalid
flash[:error] = 'Could not delete question.'