#1136 代码过长,换行处理

This commit is contained in:
z9hang 2014-09-03 17:17:45 +08:00
parent c2020a9535
commit ae40e1341a
1 changed files with 3 additions and 2 deletions

View File

@ -180,9 +180,10 @@ class AttachmentsController < ApplicationController
end
respond_to do |format|
# modify by nwb
if !@attachment.container.nil? &&
(@attachment.container.is_a?(Course) || ((@attachment.container.has_attribute?(:course) ||@attachment.container.has_attribute?(:course_id) ) && @attachment.container.course ) || ((@attachment.container.has_attribute?(:board) || @attachment.container.has_attribute?(:board_id)) && @attachment.container.board && @attachment.container.board.course ) )
(@attachment.container.is_a?(Course) || ((@attachment.container.has_attribute?(:course) || @attachment.container.has_attribute?(:course_id) ) &&
@attachment.container.course ) || ((@attachment.container.has_attribute?(:board) || @attachment.container.has_attribute?(:board_id)) &&
@attachment.container.board && @attachment.container.board.course ) )
if @attachment.container.is_a?(News)
format.html { redirect_to_referer_or news_path(@attachment.container) }
elsif @attachment.container.is_a?(Message)