diff options
| author | Luc Donnet | 2016-11-03 11:02:28 +0100 |
|---|---|---|
| committer | Luc Donnet | 2016-11-03 11:02:28 +0100 |
| commit | 552611c5a96134eff8515bbfe32870e900225bfb (patch) | |
| tree | c3b7cc795d60d390457d201feb7cb845f4b433dd /app/controllers/referentials_controller.rb | |
| parent | 7212356ab15ea1807c28a8dce4a11290d47facac (diff) | |
| parent | d67ed4c32b338070e4e4ff33f89fe64011e14c3b (diff) | |
| download | chouette-core-552611c5a96134eff8515bbfe32870e900225bfb.tar.bz2 | |
Merge branch 'master' of github.com:AF83/stif-boiv
Diffstat (limited to 'app/controllers/referentials_controller.rb')
| -rw-r--r-- | app/controllers/referentials_controller.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/controllers/referentials_controller.rb b/app/controllers/referentials_controller.rb index 4ffb6ad65..3ae59f975 100644 --- a/app/controllers/referentials_controller.rb +++ b/app/controllers/referentials_controller.rb @@ -7,6 +7,7 @@ class ReferentialsController < BreadcrumbController respond_to :js, :only => :show def new + @referential = Referential.new_from(Referential.find(params[:from])) if params[:from] new! do @referential.data_format = current_organisation.data_format end @@ -56,7 +57,11 @@ class ReferentialsController < BreadcrumbController end def create_resource(referential) - referential.organisation = current_organisation + if referential.created_from + referential.clone_association referential.created_from + else + referential.organisation = current_organisation + end super end @@ -74,6 +79,7 @@ class ReferentialsController < BreadcrumbController :projection_type, :data_format, :archived_at, + :created_from_id, referential_metadata_attributes: [:referential_source_id, :line_ids => []] ) end |
