aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/companies_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/companies_controller.rb')
-rw-r--r--app/controllers/companies_controller.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/controllers/companies_controller.rb b/app/controllers/companies_controller.rb
index a09cab783..bb83ffbd2 100644
--- a/app/controllers/companies_controller.rb
+++ b/app/controllers/companies_controller.rb
@@ -37,6 +37,14 @@ class CompaniesController < ChouetteController
protected
+
+ # Workaround to CustomField initialization order. See #6669
+ def build_resource
+ @company ||= end_of_association_chain.build do |r|
+ r.attributes = resource_params.first
+ end
+ end
+
def collection
scope = line_referential.companies
@q = scope.search(params[:q])