Apply IndentationWidth rubocop rule

This commit is contained in:
Javi Martín
2019-06-18 02:29:00 +02:00
parent b5b07bccd3
commit e252d82cdb
21 changed files with 119 additions and 119 deletions

View File

@@ -34,9 +34,9 @@ class Admin::Poll::Questions::Answers::VideosController < Admin::Poll::BaseContr
def destroy
notice = if @video.destroy
t("flash.actions.destroy.poll_question_answer_video")
t("flash.actions.destroy.poll_question_answer_video")
else
t("flash.actions.destroy.error")
t("flash.actions.destroy.error")
end
redirect_back(fallback_location: (request.referrer || root_path), notice: notice)
end

View File

@@ -46,16 +46,16 @@ class RelatedContentsController < ApplicationController
end
def related_object
if valid_url?
url = params[:url]
if valid_url?
url = params[:url]
related_klass = url.scan(/\/(#{RelatedContent::RELATIONABLE_MODELS.join("|")})\//)
.flatten.map { |i| i.to_s.singularize.camelize }.join("::")
related_id = url.match(/\/(\d+)(?!.*\/\d)/)[1]
related_klass = url.scan(/\/(#{RelatedContent::RELATIONABLE_MODELS.join("|")})\//)
.flatten.map { |i| i.to_s.singularize.camelize }.join("::")
related_id = url.match(/\/(\d+)(?!.*\/\d)/)[1]
@related = related_klass.singularize.camelize.constantize.find_by(id: related_id)
end
@related = related_klass.singularize.camelize.constantize.find_by(id: related_id)
end
rescue
nil
nil
end
end