dorsale 3.8.0 → 3.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2cd9ee349fdefbfd043c9e528bc07e4f5be23c67
4
- data.tar.gz: 1727d591ba6fe8a39da75b00adc47c6d1821c7ae
3
+ metadata.gz: a17406e315fbb33c48f5604ce568769965b4d3b4
4
+ data.tar.gz: e41ccc6d00e2e3d627dcc386047d5069fcc83210
5
5
  SHA512:
6
- metadata.gz: 43382375849075fec61442b60ba94f676da7831588a1c66f4223504d747ff25fdfd3bdd53ad3c0a94521f2e3db1d67507a3d60df7cadfe827bbc32a100f6afba
7
- data.tar.gz: 8e0c1a438c2fc23caab0da8dea58d584ffc4a6411fee720fc467806c7b53f313b28c2405d548398648e4ac9e767f2ed03e872e710cf142bf68c4d4c04d4cfd61
6
+ metadata.gz: 793932d453f32824948498bec31c14274aea9297c906d28d95ab818a81f3141294285098fac81cdd652563ffd0eb8502c247721fb8c44fc47af26d4b74c5318c
7
+ data.tar.gz: eef15ca0089f73911c95775d081feb8f4b6b7e176f0a5991f99334b0ae9da9c38ca1c48705a6ad8b95b919c3196c8722effa3ec6e13da0d973ecb8525585a261
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Next version
4
4
 
5
+ ## 3.8.1
6
+
7
+ - Change CV contact type default value
8
+
5
9
  ## 3.8.0
6
10
 
7
11
  - Move CV comments to events
@@ -10,8 +10,8 @@ class Dorsale::CustomerVault::Event < ::Dorsale::ApplicationRecord
10
10
  validates :person, presence: true
11
11
  validates :date, presence: true
12
12
  validates :text, presence: true
13
- validates :action, presence: true, inclusion: {in: proc {ACTIONS} }
14
- validates :contact_type, allow_blank: true, inclusion: {in: proc {CONTACT_TYPES} }
13
+ validates :action, presence: true, inclusion: {in: proc {ACTIONS} }
14
+ validates :contact_type, presence: true, inclusion: {in: proc {CONTACT_TYPES} }
15
15
 
16
16
  default_scope -> {
17
17
  all
@@ -23,5 +23,6 @@ class Dorsale::CustomerVault::Event < ::Dorsale::ApplicationRecord
23
23
 
24
24
  def assign_default_values
25
25
  assign_default :date, Date.current
26
+ assign_default :contact_type, CONTACT_TYPES.first
26
27
  end
27
28
  end
@@ -17,7 +17,7 @@
17
17
  = f.text_field :title, class: "form-control input-sm", placeholder: f.object.t(:title)
18
18
 
19
19
  .comment-contact_type-field
20
- = f.select :contact_type, customer_vault_event_contact_types_for_filter_select, {include_blank: true}, class: "form-control input-sm"
20
+ = f.select :contact_type, customer_vault_event_contact_types_for_filter_select, {include_blank: false}, class: "form-control input-sm"
21
21
 
22
22
  .comment-date-field
23
23
  = f.text_field :date, class: "form-control input-sm", placeholder: f.object.t(:date)
@@ -0,0 +1,5 @@
1
+ class CustomerVaultContactTypeDefaultValue < ActiveRecord::Migration[5.0]
2
+ def change
3
+ Dorsale::CustomerVault::Event.where(contact_type: nil).update_all(contact_type: "contact")
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module Dorsale
2
- VERSION = "3.8.0"
2
+ VERSION = "3.8.1"
3
3
  end
@@ -6,12 +6,17 @@ RSpec.describe ::Dorsale::CustomerVault::Event, type: :model do
6
6
 
7
7
  it { is_expected.to validate_presence_of :person }
8
8
  it { is_expected.to validate_presence_of :action }
9
+ it { is_expected.to validate_presence_of :contact_type }
9
10
 
10
11
  it { is_expected.to_not validate_presence_of :author }
11
- it { is_expected.to_not validate_presence_of :contact_type }
12
12
 
13
13
  it "should have a valid factory" do
14
14
  event = create(:customer_vault_event)
15
15
  expect(event).to be_valid
16
16
  end
17
+
18
+ it "should assign default values" do
19
+ expect(described_class.new.date).to be_present
20
+ expect(described_class.new.contact_type).to eq "contact"
21
+ end
17
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dorsale
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.8.0
4
+ version: 3.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - agilidée
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-23 00:00:00.000000000 Z
11
+ date: 2017-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -861,6 +861,7 @@ files:
861
861
  - db/migrate/20170915070538_dorsale_customer_vault_events_add_text.rb
862
862
  - db/migrate/20171023080507_migrate_people_comments_to_events.rb
863
863
  - db/migrate/20171023133219_customer_vault_events_add_contact_type.rb
864
+ - db/migrate/20171024075514_customer_vault_contact_type_default_value.rb
864
865
  - features/access.feature
865
866
  - features/billing_machine_id_cards.feature
866
867
  - features/billing_machine_invoices.feature