diff options
| -rw-r--r-- | app/controllers/referentials_controller.rb | 8 | ||||
| -rw-r--r-- | spec/models/referential_spec.rb | 12 |
2 files changed, 20 insertions, 0 deletions
diff --git a/app/controllers/referentials_controller.rb b/app/controllers/referentials_controller.rb index b6c82df5d..ae3411dab 100644 --- a/app/controllers/referentials_controller.rb +++ b/app/controllers/referentials_controller.rb @@ -33,6 +33,14 @@ class ReferentialsController < BreadcrumbController end end + def edit + edit! do + if @referential.in_workbench? + @referential.init_metadatas first_period_begin: Date.today, first_period_end: Date.today.advance(months: 1) + end + end + end + def destroy workbench = referential.workbench_id diff --git a/spec/models/referential_spec.rb b/spec/models/referential_spec.rb index 18c77bb92..c1205c9f0 100644 --- a/spec/models/referential_spec.rb +++ b/spec/models/referential_spec.rb @@ -83,4 +83,16 @@ describe Referential, :type => :model do end end + context "lines" do + + describe "search" do + + it "should support Ransack search method" do + expect(ref.lines.search.result.to_a).to eq(ref.lines.to_a) + end + + end + + end + end |
