Commit 779e07dc26df167d7cf6dcbd6cf46f652009fd19
Committed by
Fabio Teixeira
1 parent
dd140267
Exists in
master
and in
79 other branches
Fix new software registration and edit pages
-Using the minimal fields: name, finality and license info Signed-off-by: Gustavo Jaruga <darksshades@gmail.com> Signed-off-by: Luciano Prestes <lucianopcbr@gmail.com>
Showing
2 changed files
with
12 additions
and
12 deletions
Show diff stats
controllers/mpog_software_plugin_myprofile_controller.rb
... | ... | @@ -51,15 +51,15 @@ class MpogSoftwarePluginMyprofileController < MyProfileController |
51 | 51 | |
52 | 52 | valid_community = request.post? && @community.valid? |
53 | 53 | valid_software_info = request.post? && @software_info.valid? |
54 | - #valid_license = (request.post? && @license_info.valid?) | |
54 | + valid_license = (request.post? && @license_info.valid?) | |
55 | 55 | #valid_libraries = @list_libraries.empty? || LibraryHelper.valid_list_libraries?(@list_libraries) |
56 | 56 | #valid_database = DatabaseHelper.valid_list_database?(@list_databases) |
57 | 57 | #valid_language = SoftwareLanguageHelper.valid_list_language?(@list_languages) |
58 | 58 | #valid_operating_system = OperatingSystemHelper.valid_list_operating_system?(@list_operating_systems) |
59 | 59 | #valid_software_categories = request.post? && @software_categories.valid? |
60 | 60 | |
61 | - if valid_software_info && valid_community | |
62 | - @community = Community.create_after_moderation(user, {:environment => environment}.merge(params[:community]), @software_info ) | |
61 | + if valid_software_info && valid_license && valid_community | |
62 | + @community = Community.create_after_moderation(user, {:environment => environment}.merge(params[:community]), @software_info, @license_info ) | |
63 | 63 | redirect_to :controller => 'memberships', :action => 'index' |
64 | 64 | |
65 | 65 | unless params[:q].nil? | ... | ... |
lib/software_info.rb
... | ... | @@ -2,18 +2,18 @@ class SoftwareInfo < ActiveRecord::Base |
2 | 2 | # attr_accessible :e_mag, :icp_brasil, :intern, :e_ping, :e_arq, :operating_platform, :demonstration_url, :acronym, :objectives, :features, :license_infos_id, :community_id, :finality |
3 | 3 | attr_accessible :finality |
4 | 4 | |
5 | - #has_many :libraries, :dependent => :destroy | |
6 | - #has_many :software_databases | |
7 | - #has_many :database_descriptions, :through => :software_databases | |
8 | - #has_many :software_languages | |
9 | - #has_many :operating_systems | |
10 | - #has_many :programming_languages, :through => :software_languages | |
11 | - #has_many :operating_system_names, :through => :operating_systems | |
5 | + has_many :libraries, :dependent => :destroy | |
6 | + has_many :software_databases | |
7 | + has_many :database_descriptions, :through => :software_databases | |
8 | + has_many :software_languages | |
9 | + has_many :operating_systems | |
10 | + has_many :programming_languages, :through => :software_languages | |
11 | + has_many :operating_system_names, :through => :operating_systems | |
12 | 12 | |
13 | 13 | belongs_to :community |
14 | - #belongs_to :license_info | |
14 | + belongs_to :license_info | |
15 | 15 | |
16 | - #has_one :software_categories | |
16 | + has_one :software_categories | |
17 | 17 | |
18 | 18 | #validates :features, :objectives, |
19 | 19 | # :presence=>true, | ... | ... |