aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/workbench.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/workbench.rb')
-rw-r--r--app/models/workbench.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/workbench.rb b/app/models/workbench.rb
index b80fa64ac..eb53af7aa 100644
--- a/app/models/workbench.rb
+++ b/app/models/workbench.rb
@@ -1,4 +1,6 @@
class Workbench < ActiveRecord::Base
+ DEFAULT_WORKBENCH_NAME = "Gestion de l'offre"
+
include ObjectidFormatterSupport
belongs_to :organisation
belongs_to :line_referential
@@ -40,6 +42,11 @@ class Workbench < ActiveRecord::Base
end
end
+ def self.default
+ self.last if self.count == 1
+ where(name: DEFAULT_WORKBENCH_NAME).last
+ end
+
private
def initialize_output