Commit 9b404dbe5d0a8cf64aef97cc05f24a77e6828280

Authored by Braulio Bhavamitra
1 parent c9e6851d

rails4: disable autosave on person association

Showing 2 changed files with 3 additions and 3 deletions   Show diff stats
app/models/person.rb
... ... @@ -293,8 +293,7 @@ class Person < Profile
293 293 end
294 294  
295 295 after_update do |person|
296   - # FIXME: causes infinite loop with rails4
297   - #person.user.save!
  296 + person.user.save!
298 297 end
299 298  
300 299 def is_admin?(environment = nil)
... ...
app/models/user.rb
... ... @@ -85,7 +85,8 @@ class User < ActiveRecord::Base
85 85 end
86 86 end
87 87  
88   - has_one :person, :dependent => :destroy
  88 + # set autosave to false as we do manually when needed and Person syncs with us
  89 + has_one :person, dependent: :destroy, autosave: false
89 90 belongs_to :environment
90 91  
91 92 attr_protected :activated_at
... ...