From fd3d68cec637efda68fde48fd62de764a8b3bb57 Mon Sep 17 00:00:00 2001 From: David Carlos Date: Thu, 11 Dec 2014 16:54:25 +0000 Subject: [PATCH] Creates constroy_software method in mpog_software_plugin_myprofile_controller. --- controllers/mpog_software_plugin_myprofile_controller.rb | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/controllers/mpog_software_plugin_myprofile_controller.rb b/controllers/mpog_software_plugin_myprofile_controller.rb index 72967d8..30f822f 100644 --- a/controllers/mpog_software_plugin_myprofile_controller.rb +++ b/controllers/mpog_software_plugin_myprofile_controller.rb @@ -25,14 +25,7 @@ class MpogSoftwarePluginMyprofileController < MyProfileController else LicenseInfo.find(:first, :conditions =>["version = ?","#{params[:license_info][:version]}"]) end - - valid_models = request.post? && (@community.valid? && @software_info.valid? && @license_info.valid?) - - if valid_models - send_software_to_moderation - else - add_software_erros - end + control_software_creation end def search_offerers @@ -77,6 +70,15 @@ class MpogSoftwarePluginMyprofileController < MyProfileController @errors |= @license_info.errors.full_messages end + def control_software_creation + valid_models = request.post? && (@community.valid? && @software_info.valid? && @license_info.valid?) + if valid_models + send_software_to_moderation + else + add_software_erros + end + end + def update_institution @institution.community.update_attributes(params[:community]) @institution.update_attributes(params[:institutions].except(:governmental_power, :governmental_sphere, :juridical_nature)) -- libgit2 0.21.2