diff options
| author | Zog | 2018-04-20 09:41:42 +0200 |
|---|---|---|
| committer | Zog | 2018-04-20 09:41:42 +0200 |
| commit | 0ac844bde0ee251463e4eae7691906c39445767d (patch) | |
| tree | f7ab772cd255b49d7c28c02f2bbcccfcc84706ae | |
| parent | ed47d8d2725700f67bd45a2f6c55477cd2c13634 (diff) | |
| download | chouette-core-0ac844bde0ee251463e4eae7691906c39445767d.tar.bz2 | |
Refs #6630; Fix CleanUps Controller6630-clean-up-fix-attempt
Fix cleanups in the process
| -rw-r--r-- | app/controllers/clean_ups_controller.rb | 10 | ||||
| -rw-r--r-- | app/controllers/concerns/metadata_controller_support.rb | 2 | ||||
| -rw-r--r-- | app/models/clean_up.rb | 2 | ||||
| -rw-r--r-- | db/migrate/20180420073801_fix_typo_in_cleanup_results.rb | 5 |
4 files changed, 12 insertions, 7 deletions
diff --git a/app/controllers/clean_ups_controller.rb b/app/controllers/clean_ups_controller.rb index ec28aa0fc..c25df1a00 100644 --- a/app/controllers/clean_ups_controller.rb +++ b/app/controllers/clean_ups_controller.rb @@ -4,12 +4,12 @@ class CleanUpsController < ChouetteController belongs_to :referential def create - clean_up = CleanUp.new(clean_up_params) - clean_up.referential = @referential - if clean_up.valid? - clean_up.save + @clean_up = CleanUp.new(clean_up_params) + @clean_up.referential = @referential + if @clean_up.valid? + @clean_up.save else - flash[:alert] = clean_up.errors.full_messages.join("<br/>") + flash[:alert] = @clean_up.errors.full_messages.join("<br/>") end redirect_to referential_path(@referential) end diff --git a/app/controllers/concerns/metadata_controller_support.rb b/app/controllers/concerns/metadata_controller_support.rb index fc7c9c3df..4dcbfe5d0 100644 --- a/app/controllers/concerns/metadata_controller_support.rb +++ b/app/controllers/concerns/metadata_controller_support.rb @@ -2,7 +2,7 @@ module MetadataControllerSupport extend ActiveSupport::Concern included do - after_action :set_creator_metadata, only: :create, unless: Proc.new {|c| c.is_a? CleanUpsController } + after_action :set_creator_metadata, only: :create after_action :set_modifier_metadata, only: :update end diff --git a/app/models/clean_up.rb b/app/models/clean_up.rb index ec9d7cd74..ec47489e9 100644 --- a/app/models/clean_up.rb +++ b/app/models/clean_up.rb @@ -1,4 +1,4 @@ -class CleanUp < ::ActiveRecord::Base +class CleanUp < ApplicationModel extend Enumerize include AASM belongs_to :referential diff --git a/db/migrate/20180420073801_fix_typo_in_cleanup_results.rb b/db/migrate/20180420073801_fix_typo_in_cleanup_results.rb new file mode 100644 index 000000000..2e616d3e1 --- /dev/null +++ b/db/migrate/20180420073801_fix_typo_in_cleanup_results.rb @@ -0,0 +1,5 @@ +class FixTypoInCleanupResults < ActiveRecord::Migration + def change + rename_column :clean_up_results, :message_attributs, :message_attributes + end +end |
