From 08cf75fb953410eebe4eda1e3366cdad817d868d Mon Sep 17 00:00:00 2001 From: kikito Date: Sat, 12 Sep 2015 19:30:26 +0200 Subject: [PATCH] Fixes bug: users were creating new organisations instead of updating existing ones --- app/models/user.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index 3ddf4df54..723f92458 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -32,7 +32,7 @@ class User < ActiveRecord::Base validates_associated :organization, message: false - accepts_nested_attributes_for :organization + accepts_nested_attributes_for :organization, update_only: true scope :administrators, -> { joins(:administrators) } scope :moderators, -> { joins(:moderator) }