diff --git a/app/controllers/enterprise_controller.rb b/app/controllers/enterprise_controller.rb index d805486..23a1209 100644 --- a/app/controllers/enterprise_controller.rb +++ b/app/controllers/enterprise_controller.rb @@ -14,6 +14,7 @@ class EnterpriseController < ApplicationController def register @enterprise = Enterprise.new(params[:enterprise]) + @enterprise.identifier = @enterprise.name if @enterprise.save @enterprise.people << current_user.person flash[:notice] = _('Enterprise was succesfully created') diff --git a/app/models/enterprise.rb b/app/models/enterprise.rb index fa2bc6b..bdf162b 100644 --- a/app/models/enterprise.rb +++ b/app/models/enterprise.rb @@ -1,5 +1,6 @@ #A enterprise is a kind of profile. According to the system concept, only enterprises can offer priducts/services class Enterprise < Profile - validates_numericality_of :foundation_year, :only_integer => true + validates_numericality_of :foundation_year, :only_integer => true, :allow_nil => true + end diff --git a/app/views/enterprise/_enterprise.rhtml b/app/views/enterprise/_enterprise.rhtml index b42ec0f..cfea5a2 100644 --- a/app/views/enterprise/_enterprise.rhtml +++ b/app/views/enterprise/_enterprise.rhtml @@ -1 +1 @@ -
<%= submit_tag _('Register') %> -<%= link_to _('Cancel'), :action => 'register' %>
+<%= link_to _('Cancel'), :action => 'index' %> <% end %> -- libgit2 0.21.2