rubocop files update and auto correction
This commit is contained in:
parent
42e8bb11ea
commit
2a30b076b8
88 changed files with 519 additions and 452 deletions
|
|
@ -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.'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue