From 61d0aa09f461fd441997c44ea79bda8a24254986 Mon Sep 17 00:00:00 2001 From: Rodrigo Souto Date: Mon, 29 Oct 2012 20:09:26 +0000 Subject: [PATCH] Setting author on upload --- app/controllers/my_profile/cms_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/my_profile/cms_controller.rb b/app/controllers/my_profile/cms_controller.rb index 8c6c858..99f54cb 100644 --- a/app/controllers/my_profile/cms_controller.rb +++ b/app/controllers/my_profile/cms_controller.rb @@ -161,7 +161,7 @@ class CmsController < MyProfileController end if request.post? && params[:uploaded_files] params[:uploaded_files].each do |file| - @uploaded_files << UploadedFile.create(:uploaded_data => file, :profile => profile, :parent => @parent) unless file == '' + @uploaded_files << UploadedFile.create(:uploaded_data => file, :profile => profile, :parent => @parent, :author => user) unless file == '' end @errors = @uploaded_files.select { |f| f.errors.any? } if @errors.any? -- libgit2 0.21.2