Commit 5d91f910005a99f02438b2308a61770f414797f3

Authored by Leandro Santos
Committed by Antonio Terceiro
1 parent 061eb85d

fixing bugs on account controller

@@ -20,6 +20,14 @@ on lib/acts_as_having_settings @@ -20,6 +20,14 @@ on lib/acts_as_having_settings
20 20
21 I used the solution 1. 21 I used the solution 1.
22 22
  23 +I choose solution number 2 for Environment model. I think it is more clear in this situation.
  24 +I put the code:
  25 +
  26 + self.partial_updates = false
  27 +
  28 +on Environment model.
  29 +
  30 +
23 4 - acts_as_searchable -> find_by_contents 31 4 - acts_as_searchable -> find_by_contents
24 32
25 I solved an incompatibility between paginate and geokit with an work around like this the one explained on the link: 33 I solved an incompatibility between paginate and geokit with an work around like this the one explained on the link:
app/controllers/public/account_controller.rb
@@ -49,7 +49,8 @@ class AccountController < ApplicationController @@ -49,7 +49,8 @@ class AccountController < ApplicationController
49 @user.terms_of_use = environment.terms_of_use 49 @user.terms_of_use = environment.terms_of_use
50 @user.environment = environment 50 @user.environment = environment
51 @terms_of_use = environment.terms_of_use 51 @terms_of_use = environment.terms_of_use
52 - @person = @user.build_person(params[:profile_data]) 52 + @person = Person.new(params[:profile_data])
  53 + @person.name = @user.login
53 @person.environment = @user.environment 54 @person.environment = @user.environment
54 if request.post? && params[self.icaptcha_field].blank? 55 if request.post? && params[self.icaptcha_field].blank?
55 @user.signup! 56 @user.signup!
app/models/environment.rb
@@ -3,6 +3,8 @@ @@ -3,6 +3,8 @@
3 # domains. 3 # domains.
4 class Environment < ActiveRecord::Base 4 class Environment < ActiveRecord::Base
5 5
  6 + self.partial_updates = false
  7 +
6 has_many :tasks, :dependent => :destroy, :as => 'target' 8 has_many :tasks, :dependent => :destroy, :as => 'target'
7 9
8 PERMISSIONS['Environment'] = { 10 PERMISSIONS['Environment'] = {