Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix issue 7 of the original ezfaq [1].

Changes ard made to meet a modification of redmine [2]:
"Refactor: Moved ApplicationController#attach_files to the Attachment model"

[1] https://github.com/zouchaoqun/ezfaq/issues#issue/7
[2] edavis10/redmine@0fd7e2d
  • Loading branch information...
commit 1d855089a151befd466086146ec1b2ee6d786d6c 1 parent 7c12aef
@ansoncat authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 app/controllers/ezfaq_controller.rb
View
6 app/controllers/ezfaq_controller.rb
@@ -74,7 +74,8 @@ def new
@faq.is_valid = true
@faq.viewed_count = 0
if @faq.save
- attach_files(@faq, params[:attachments])
+ attachments = Attachment.attach_files(@faq, params[:attachments])
+ render_attachment_warning_if_needed(@faq)
flash[:notice] = l(:notice_successful_create)
FaqMailer.deliver_faq_add(@project, @faq)
redirect_to :controller => 'ezfaq', :action => 'show', :id => @project, :faq_id => @faq
@@ -96,7 +97,8 @@ def edit
@faq.attributes = params[:faq]
@faq.updater_id = User.current.id
if @faq.save
- attach_files(@faq, params[:attachments])
+ attachments = Attachment.attach_files(@faq, params[:attachments])
+ render_attachment_warning_if_needed(@faq)
flash[:notice] = l(:notice_successful_update)
FaqMailer.deliver_faq_update(@project, @faq)
redirect_to :controller => 'ezfaq', :action => 'show', :id => @project, :faq_id => @faq
Please sign in to comment.
Something went wrong with that request. Please try again.