diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 215df8e10..c511b5ace 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -195,6 +195,8 @@ class AttachmentsController < ApplicationController end elsif !@attachment.container.nil? && @attachment.container.is_a?(Softapplication) format.html { redirect_to_referer_or softapplications_path(@attachment.container) } + elsif !@attachment.container.nil? && @attachment.container.is_a?(Bid) + format.html { redirect_to_referer_or respond_path(@attachment.container) } else if @project.nil? format.html { redirect_to_referer_or forum_memo_path(@attachment.container.forum, @attachment.container) } diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb index 4964e6cd2..26d61f94e 100644 --- a/app/helpers/welcome_helper.rb +++ b/app/helpers/welcome_helper.rb @@ -137,7 +137,7 @@ module WelcomeHelper #获取课程列表 # add by nwb def find_miracle_course(sum=10, max_rate=7, school_id) - if User.current.user_extensions.school.nil? and school_id.nil? + if User.current.user_extensions.nil? && User.current.user_extensions.school.nil? and school_id.nil? Course.active.visible. joins(:memberships). group('members.course_id'). diff --git a/app/models/softapplication.rb b/app/models/softapplication.rb index 0234bc118..9e469d2ac 100644 --- a/app/models/softapplication.rb +++ b/app/models/softapplication.rb @@ -1,6 +1,6 @@ class Softapplication < ActiveRecord::Base attr_accessible :android_min_version_available, :app_type_id, :app_type_name, :description, :name, :user_id, :contest_id, :application_developers, :deposit_project_url, :deposit_project - acts_as_attachable + acts_as_attachable :view_permission => :view_files seems_rateable :allow_update => true, :dimensions => :quality diff --git a/app/views/attachments/_form.html.erb b/app/views/attachments/_form.html.erb index 5c22ff44c..d6cbb72fe 100644 --- a/app/views/attachments/_form.html.erb +++ b/app/views/attachments/_form.html.erb @@ -3,14 +3,17 @@ <% container.attachments.each_with_index do |attachment, i| %>
<% end %> diff --git a/app/views/bids/show.html.erb b/app/views/bids/show.html.erb index f4ebcafa6..5545a8c14 100644 --- a/app/views/bids/show.html.erb +++ b/app/views/bids/show.html.erb @@ -16,7 +16,7 @@