aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorLuc Donnet2018-05-04 09:55:12 +0200
committerGitHub2018-05-04 09:55:12 +0200
commit4438611e99c12faefdc73ff6cbd966951bc6dd1b (patch)
treeaaa19e2a194063c222c0e26c7a16877dcbecdf7c /app
parentfc71f67eb75f956aa2c3e1aae85e99b5b82bc0a3 (diff)
parentfc427e5807f62416fdc93a8c6dda006137f06537 (diff)
downloadchouette-core-4438611e99c12faefdc73ff6cbd966951bc6dd1b.tar.bz2
Merge pull request #549 from af83/6920-activate-newly-created-referentials
6920 activate newly created referentials
Diffstat (limited to 'app')
-rw-r--r--app/decorators/referential_decorator.rb2
-rw-r--r--app/models/referential.rb1
2 files changed, 2 insertions, 1 deletions
diff --git a/app/decorators/referential_decorator.rb b/app/decorators/referential_decorator.rb
index e01987e59..db6261120 100644
--- a/app/decorators/referential_decorator.rb
+++ b/app/decorators/referential_decorator.rb
@@ -36,7 +36,7 @@ class ReferentialDecorator < AF83::Decorator
l.method :put
end
- instance_decorator.action_link policy: :unarchive, secondary: :show, on: :show do |l|
+ instance_decorator.action_link policy: :unarchive, secondary: :show do |l|
l.content t('actions.unarchive')
l.href { h.unarchive_referential_path(object.id) }
l.method :put
diff --git a/app/models/referential.rb b/app/models/referential.rb
index b4f64fad1..792353a73 100644
--- a/app/models/referential.rb
+++ b/app/models/referential.rb
@@ -322,6 +322,7 @@ class Referential < ApplicationModel
before_create :create_schema
after_create :clone_schema, if: :created_from
+ after_create :active!, unless: :created_from
before_destroy :destroy_schema
before_destroy :destroy_jobs