dorsale 3.17.0 → 3.18.0

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
  SHA256:
3
- metadata.gz: edb8363b4a987b737cfba9c432a65fd5c64fbb72690c51f6ea5da99c195430a6
4
- data.tar.gz: 9b88ffbea03b8971f2a853c5dfcbe6387670ec7b69d8601d68ab295ba425364c
3
+ metadata.gz: f967e032d9c4918a372978e3c92216d542751e9e29881843aa029c7d63be401f
4
+ data.tar.gz: 35fbc1b26a2dea2067f936674324804b8d02fd6a673adfd92354886060b56ced
5
5
  SHA512:
6
- metadata.gz: c84800985f5243887825313437907d6a40d2ab5398e7c78de903d404a9c3d5e1d01e6bed9c7cee4fe57f15af26d0aa0c1950ede73946dd3d3f8c14a7ce20a6e1
7
- data.tar.gz: 373d7d5e133bcb61443e8defed065177fb6e82fc56bc7424abbb110f3632d51a07a24df569f96d2b336206339a2774d26c206d5b1ff6e6862f6d5b63baa061fb
6
+ metadata.gz: b0bb3cf0a9cd7322cc3e6928101ba486c8dddd577fa9962f1c462612d3c876e2df525224acdc6a2a4902510943ca61c500986431a6b1e895313f246c60467826
7
+ data.tar.gz: 135ff2e5848baede200b8ab36ba6bed2078f1c56024a8a1e901bcad21b9ae3f0bb700a314d74582006ae9275d6779f082bbcd6d17577af38f9296291fa379c76
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Next version
4
4
 
5
+ # 3.18.0
6
+ - Change uploaders `extension_whitelist` to `extension_allowlist`
7
+ - Rails 6.1 compatibility
8
+
5
9
  ## 3.17.0
6
10
  - Refactor CV models using stores
7
11
  - Fix redirect after task comment create
@@ -55,7 +55,7 @@ class Dorsale::BillingMachine::Invoice < ::Dorsale::ApplicationRecord
55
55
  lines.each(&:update_total)
56
56
  apply_vat_rate_to_lines
57
57
 
58
- lines_sum = lines.map(&:total).sum.round(2)
58
+ lines_sum = lines.sum(&:total).round(2)
59
59
 
60
60
  self.total_excluding_taxes = lines_sum - commercial_discount
61
61
 
@@ -109,9 +109,7 @@ class Dorsale::BillingMachine::Invoice < ::Dorsale::ApplicationRecord
109
109
  def payment_status
110
110
  if paid?
111
111
  :paid
112
- elsif due_date.nil?
113
- :on_alert
114
- elsif Date.current >= due_date + 15
112
+ elsif due_date.nil? || Date.current >= due_date + 15
115
113
  :on_alert
116
114
  elsif Date.current > due_date
117
115
  :late
@@ -61,7 +61,7 @@ class Dorsale::BillingMachine::Quotation < ::Dorsale::ApplicationRecord
61
61
  lines.each(&:update_total)
62
62
  apply_vat_rate_to_lines
63
63
 
64
- lines_sum = lines.map(&:total).sum
64
+ lines_sum = lines.sum(&:total)
65
65
 
66
66
  self.total_excluding_taxes = lines_sum - commercial_discount
67
67
 
@@ -10,7 +10,7 @@ class Dorsale::CustomerVault::Person < ::Dorsale::ApplicationRecord
10
10
  end
11
11
 
12
12
  def verify_class
13
- if self.class == ::Dorsale::CustomerVault::Person
13
+ if instance_of?(Dorsale::CustomerVault::Person)
14
14
  # self.abstract_class does not work with STI
15
15
  raise "Cannot directly instantiate Person class"
16
16
  end
@@ -29,17 +29,17 @@ class Dorsale::ExpenseGun::Expense < ::Dorsale::ApplicationRecord
29
29
 
30
30
  # Sum of line amounts
31
31
  def total_all_taxes
32
- expense_lines.map(&:total_all_taxes).sum
32
+ expense_lines.sum(&:total_all_taxes)
33
33
  end
34
34
 
35
35
  # Sum of line emplee payback
36
36
  def total_employee_payback
37
- expense_lines.map(&:employee_payback).sum
37
+ expense_lines.sum(&:employee_payback)
38
38
  end
39
39
 
40
40
  # Sum of deductible deductible vat
41
41
  def total_vat_deductible
42
- expense_lines.map(&:total_vat_deductible).sum
42
+ expense_lines.sum(&:total_vat_deductible)
43
43
  end
44
44
 
45
45
  delegate :current_state, to: :aasm
@@ -29,7 +29,7 @@ class Dorsale::Flyboy::Task::Snoozer < ::Dorsale::Service
29
29
  task.reminder_date <= current_date
30
30
  elsif task.term
31
31
  task.term <= current_date
32
- else
32
+ else # rubocop:disable Lint/DuplicateBranch
33
33
  false
34
34
  end
35
35
  end
@@ -1,5 +1,5 @@
1
1
  class Dorsale::ImageUploader < ::Dorsale::ApplicationUploader
2
- def extension_whitelist
2
+ def extension_allowlist
3
3
  %w(jpg jpeg gif png)
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  class Dorsale::PdfUploader < ::Dorsale::ApplicationUploader
2
- def extension_whitelist
2
+ def extension_allowlist
3
3
  %w(pdf)
4
4
  end
5
5
  end
@@ -1,3 +1,3 @@
1
1
  module Dorsale
2
- VERSION = "3.17.0"
2
+ VERSION = "3.18.0"
3
3
  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.17.0
4
+ version: 3.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - agilidée
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-11 00:00:00.000000000 Z
11
+ date: 2021-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -973,7 +973,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
973
973
  - !ruby/object:Gem::Version
974
974
  version: '0'
975
975
  requirements: []
976
- rubygems_version: 3.1.4
976
+ rubygems_version: 3.1.6
977
977
  signing_key:
978
978
  specification_version: 4
979
979
  summary: Modular ERP made with Ruby on Rails