dorsale 4.0.0 → 4.1.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.
Files changed (146) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/app/controllers/dorsale/alexandrie/attachments_controller.rb +1 -1
  4. data/app/controllers/dorsale/application_controller.rb +1 -1
  5. data/app/controllers/dorsale/billing_machine/application_controller.rb +1 -1
  6. data/app/controllers/dorsale/billing_machine/invoices_controller.rb +1 -1
  7. data/app/controllers/dorsale/billing_machine/payment_terms_controller.rb +1 -1
  8. data/app/controllers/dorsale/billing_machine/quotations_controller.rb +1 -1
  9. data/app/controllers/dorsale/comments_controller.rb +1 -1
  10. data/app/controllers/dorsale/customer_vault/activity_types_controller.rb +1 -1
  11. data/app/controllers/dorsale/customer_vault/application_controller.rb +1 -1
  12. data/app/controllers/dorsale/customer_vault/events_controller.rb +1 -1
  13. data/app/controllers/dorsale/customer_vault/links_controller.rb +1 -1
  14. data/app/controllers/dorsale/customer_vault/origins_controller.rb +1 -1
  15. data/app/controllers/dorsale/customer_vault/people_controller.rb +1 -1
  16. data/app/controllers/dorsale/expense_gun/application_controller.rb +1 -1
  17. data/app/controllers/dorsale/expense_gun/categories_controller.rb +1 -1
  18. data/app/controllers/dorsale/flyboy/application_controller.rb +1 -1
  19. data/app/controllers/dorsale/flyboy/task_comments_controller.rb +1 -1
  20. data/app/controllers/dorsale/flyboy/tasks_controller.rb +1 -1
  21. data/app/controllers/dorsale/users_controller.rb +1 -1
  22. data/app/filters/dorsale/billing_machine/small_data/filter_for_invoices.rb +1 -1
  23. data/app/filters/dorsale/billing_machine/small_data/filter_for_quotations.rb +1 -1
  24. data/app/filters/dorsale/billing_machine/small_data/filter_strategy_by_customer.rb +1 -1
  25. data/app/filters/dorsale/billing_machine/small_data/filter_strategy_by_payment_status.rb +1 -1
  26. data/app/filters/dorsale/billing_machine/small_data/filter_strategy_by_state.rb +1 -1
  27. data/app/filters/dorsale/customer_vault/small_data/filter_for_events.rb +1 -1
  28. data/app/filters/dorsale/customer_vault/small_data/filter_for_people.rb +1 -1
  29. data/app/filters/dorsale/customer_vault/small_data/filter_strategy_by_activity_type.rb +1 -1
  30. data/app/filters/dorsale/expense_gun/small_data/filter_for_expenses.rb +1 -1
  31. data/app/filters/dorsale/flyboy/small_data/filter_for_tasks.rb +1 -1
  32. data/app/filters/dorsale/flyboy/small_data/filter_strategy_by_task_state.rb +2 -2
  33. data/app/mailers/dorsale/application_mailer.rb +1 -1
  34. data/app/mailers/dorsale/flyboy/task_mailer.rb +1 -1
  35. data/app/mailers/dorsale/user_mailer.rb +1 -1
  36. data/app/models/dorsale/address.rb +3 -3
  37. data/app/models/dorsale/alexandrie/attachment.rb +1 -1
  38. data/app/models/dorsale/alexandrie/attachment_type.rb +1 -1
  39. data/app/models/dorsale/billing_machine/invoice.rb +1 -1
  40. data/app/models/dorsale/billing_machine/invoice_line.rb +1 -1
  41. data/app/models/dorsale/billing_machine/payment_term.rb +1 -1
  42. data/app/models/dorsale/billing_machine/quotation.rb +2 -2
  43. data/app/models/dorsale/billing_machine/quotation_line.rb +1 -1
  44. data/app/models/dorsale/comment.rb +1 -1
  45. data/app/models/dorsale/customer_vault/activity_type.rb +1 -1
  46. data/app/models/dorsale/customer_vault/corporation.rb +2 -2
  47. data/app/models/dorsale/customer_vault/event.rb +3 -3
  48. data/app/models/dorsale/customer_vault/individual.rb +2 -2
  49. data/app/models/dorsale/customer_vault/link.rb +1 -1
  50. data/app/models/dorsale/customer_vault/origin.rb +1 -1
  51. data/app/models/dorsale/customer_vault/person.rb +5 -5
  52. data/app/models/dorsale/expense_gun/category.rb +1 -1
  53. data/app/models/dorsale/expense_gun/expense.rb +2 -2
  54. data/app/models/dorsale/expense_gun/expense_line.rb +1 -1
  55. data/app/models/dorsale/flyboy/task.rb +4 -4
  56. data/app/models/dorsale/flyboy/task_comment.rb +1 -1
  57. data/app/pdfs/dorsale/application_pdf.rb +1 -1
  58. data/app/pdfs/dorsale/billing_machine/invoice_multiple_vat_pdf.rb +13 -13
  59. data/app/pdfs/dorsale/billing_machine/invoice_single_vat_pdf.rb +13 -13
  60. data/app/pdfs/dorsale/billing_machine/quotation_multiple_vat_pdf.rb +1 -1
  61. data/app/pdfs/dorsale/billing_machine/quotation_single_vat_pdf.rb +1 -1
  62. data/app/pdfs/dorsale/expense_gun/expense_pdf.rb +2 -2
  63. data/app/pdfs/dorsale/prawn_helpers.rb +2 -2
  64. data/app/policies/dorsale/application_policy.rb +1 -1
  65. data/app/services/dorsale/billing_machine/invoice/copy.rb +1 -1
  66. data/app/services/dorsale/billing_machine/invoice/statistics.rb +2 -2
  67. data/app/services/dorsale/billing_machine/quotation/copy.rb +1 -1
  68. data/app/services/dorsale/billing_machine/quotation/statistics.rb +2 -2
  69. data/app/services/dorsale/billing_machine/quotation/to_invoice.rb +5 -5
  70. data/app/services/dorsale/expense_gun/expense/copy.rb +1 -1
  71. data/app/services/dorsale/flyboy/task/copy.rb +1 -1
  72. data/app/services/dorsale/flyboy/task/snoozer.rb +1 -1
  73. data/app/services/dorsale/service.rb +2 -2
  74. data/app/services/dorsale/tag_list_for_model.rb +1 -1
  75. data/app/uploaders/dorsale/alexandrie/file_uploader.rb +1 -1
  76. data/app/uploaders/dorsale/application_uploader.rb +1 -1
  77. data/app/uploaders/dorsale/avatar_uploader.rb +1 -1
  78. data/app/uploaders/dorsale/image_uploader.rb +2 -2
  79. data/app/uploaders/dorsale/pdf_uploader.rb +2 -2
  80. data/app/views/dorsale/customer_vault/people/index.xlsx.ruby +3 -3
  81. data/features/step_definitions/billing_machine_invoices_steps.rb +3 -3
  82. data/features/step_definitions/billing_machine_multiple_vat.rb +1 -1
  83. data/features/step_definitions/billing_machine_quotations_steps.rb +2 -2
  84. data/features/step_definitions/customer_vault_corporations_steps.rb +3 -3
  85. data/features/step_definitions/customer_vault_tasks_steps.rb +3 -3
  86. data/lib/dorsale/engine.rb +5 -5
  87. data/lib/dorsale/version.rb +1 -1
  88. data/spec/controllers/dorsale/alexandrie/attachments_controller_spec.rb +1 -1
  89. data/spec/controllers/dorsale/customer_vault/events_controller_spec.rb +1 -1
  90. data/spec/controllers/dorsale/customer_vault/people_controller_spec.rb +1 -1
  91. data/spec/controllers/dorsale/expense_gun/expenses_controller_spec.rb +1 -1
  92. data/spec/factories/alexandrie_attachment_types.rb +1 -1
  93. data/spec/factories/alexandrie_attachments.rb +1 -1
  94. data/spec/factories/billing_machine_invoice_lines.rb +1 -1
  95. data/spec/factories/billing_machine_invoices.rb +1 -1
  96. data/spec/factories/billing_machine_payment_terms.rb +1 -1
  97. data/spec/factories/billing_machine_quotation_lines.rb +1 -1
  98. data/spec/factories/billing_machine_quotations.rb +1 -1
  99. data/spec/factories/customer_vault_activity_types.rb +1 -1
  100. data/spec/factories/customer_vault_corporations.rb +1 -1
  101. data/spec/factories/customer_vault_event.rb +1 -1
  102. data/spec/factories/customer_vault_individuals.rb +1 -1
  103. data/spec/factories/customer_vault_links.rb +1 -1
  104. data/spec/factories/customer_vault_origins.rb +1 -1
  105. data/spec/factories/dorsale_addresses.rb +1 -1
  106. data/spec/factories/dorsale_comments.rb +1 -1
  107. data/spec/factories/expense_gun_categories.rb +1 -1
  108. data/spec/factories/expense_gun_expense_lines.rb +1 -1
  109. data/spec/factories/expense_gun_expenses.rb +1 -1
  110. data/spec/factories/flyboy_task_comments.rb +1 -1
  111. data/spec/factories/flyboy_tasks.rb +1 -1
  112. data/spec/mailers/user_mailer_spec.rb +2 -2
  113. data/spec/models/dorsale/alexandrie/attachment_spec.rb +1 -1
  114. data/spec/models/dorsale/alexandrie/attachment_type_spec.rb +1 -1
  115. data/spec/models/dorsale/billing_machine/invoice_spec.rb +5 -5
  116. data/spec/models/dorsale/billing_machine/quotation_line_spec.rb +1 -1
  117. data/spec/models/dorsale/billing_machine/quotation_spec.rb +4 -4
  118. data/spec/models/dorsale/billing_machine_spec.rb +1 -1
  119. data/spec/models/dorsale/customer_vault/activity_type_spec.rb +1 -1
  120. data/spec/models/dorsale/customer_vault/corporation_spec.rb +1 -1
  121. data/spec/models/dorsale/customer_vault/event_spec.rb +1 -1
  122. data/spec/models/dorsale/customer_vault/individual_spec.rb +1 -1
  123. data/spec/models/dorsale/customer_vault/link_spec.rb +1 -1
  124. data/spec/models/dorsale/customer_vault/origin_spec.rb +1 -1
  125. data/spec/models/dorsale/customer_vault/person_spec.rb +1 -1
  126. data/spec/models/dorsale/expense_gun/category_spec.rb +1 -1
  127. data/spec/models/dorsale/expense_gun/expense_line_spec.rb +1 -1
  128. data/spec/models/dorsale/flyboy/task_spec.rb +5 -5
  129. data/spec/models/dorsale/i18n_spec.rb +1 -1
  130. data/spec/pdfs/dorsale/billing_machine/invoice_multiple_vat_pdf_spec.rb +3 -3
  131. data/spec/pdfs/dorsale/billing_machine/invoice_single_vat_pdf_spec.rb +3 -3
  132. data/spec/pdfs/dorsale/billing_machine/quotation_multiple_vat_pdf_spec.rb +3 -3
  133. data/spec/pdfs/dorsale/billing_machine/quotation_single_vat_pdf_spec.rb +3 -3
  134. data/spec/rails_helper.rb +0 -3
  135. data/spec/routing/dorsale/billing_machine/invoices_routing_spec.rb +2 -2
  136. data/spec/routing/dorsale/billing_machine/quotations_routing_spec.rb +2 -2
  137. data/spec/routing/dorsale/customer_vault/activity_types_routing_spec.rb +2 -2
  138. data/spec/routing/dorsale/customer_vault/events_routing_spec.rb +2 -2
  139. data/spec/routing/dorsale/customer_vault/origins_routing_spec.rb +2 -2
  140. data/spec/routing/dorsale/customer_vault/people_routing_spec.rb +2 -2
  141. data/spec/routing/dorsale/expense_gun/expenses_routing_spec.rb +2 -2
  142. data/spec/routing/dorsale/flyboy/task_comments_routing_spec.rb +2 -2
  143. data/spec/routing/dorsale/flyboy/tasks_routing_spec.rb +2 -2
  144. data/spec/routing/dorsale/users_routing_spec.rb +2 -2
  145. data/spec/services/dorsale/expense_gun/expense/copy_spec.rb +2 -2
  146. metadata +48 -51
@@ -150,7 +150,7 @@ class Dorsale::BillingMachine::InvoiceSingleVatPdf < Dorsale::ApplicationPdf
150
150
  content << main_document.customer.european_union_vat_number
151
151
  end
152
152
 
153
- content.select(&:present?).join("\n")
153
+ content.compact_blank.join("\n")
154
154
  end
155
155
 
156
156
  def build_customer
@@ -214,11 +214,11 @@ class Dorsale::BillingMachine::InvoiceSingleVatPdf < Dorsale::ApplicationPdf
214
214
  bb height: height do
215
215
  table_products = [
216
216
  [
217
- main_document.t(:designation).mb_chars.upcase.to_s,
218
- main_document.t(:quantity).mb_chars.upcase.to_s,
219
- main_document.t(:unit).mb_chars.upcase.to_s,
220
- main_document.t(:unit_price).mb_chars.upcase.to_s,
221
- main_document.t(:line_total).mb_chars.upcase.to_s,
217
+ main_document.t(:designation).upcase.to_s,
218
+ main_document.t(:quantity).upcase.to_s,
219
+ main_document.t(:unit).upcase.to_s,
220
+ main_document.t(:unit_price).upcase.to_s,
221
+ main_document.t(:line_total).upcase.to_s,
222
222
  ],
223
223
  ]
224
224
 
@@ -260,35 +260,35 @@ class Dorsale::BillingMachine::InvoiceSingleVatPdf < Dorsale::ApplicationPdf
260
260
 
261
261
  if has_discount
262
262
  table_totals.push [
263
- main_document.t(:commercial_discount).mb_chars.upcase.to_s,
263
+ main_document.t(:commercial_discount).upcase.to_s,
264
264
  bm_currency(-main_document.commercial_discount),
265
265
  ]
266
266
  end
267
267
 
268
268
  table_totals.push [
269
- main_document.t(:total_excluding_taxes).mb_chars.upcase.to_s,
269
+ main_document.t(:total_excluding_taxes).upcase.to_s,
270
270
  bm_currency(main_document.total_excluding_taxes),
271
271
  ]
272
272
 
273
273
  vat_rate = number(main_document.vat_rate)
274
274
  table_totals.push [
275
- "#{main_document.t(:vat).mb_chars.upcase} #{percentage vat_rate}",
275
+ "#{main_document.t(:vat).upcase} #{percentage vat_rate}",
276
276
  bm_currency(main_document.vat_amount),
277
277
  ]
278
278
 
279
279
  if has_advance
280
280
  table_totals.push [
281
- main_document.t(:advance).mb_chars.upcase.to_s,
281
+ main_document.t(:advance).upcase.to_s,
282
282
  bm_currency(main_document.advance),
283
283
  ]
284
284
 
285
285
  table_totals.push [
286
- main_document.t(:total_including_taxes).mb_chars.upcase.to_s,
286
+ main_document.t(:total_including_taxes).upcase.to_s,
287
287
  bm_currency(main_document.balance),
288
288
  ]
289
289
  else
290
290
  table_totals.push [
291
- main_document.t(:total_including_taxes).mb_chars.upcase.to_s,
291
+ main_document.t(:total_including_taxes).upcase.to_s,
292
292
  bm_currency(main_document.total_including_taxes),
293
293
  ]
294
294
  end
@@ -325,7 +325,7 @@ class Dorsale::BillingMachine::InvoiceSingleVatPdf < Dorsale::ApplicationPdf
325
325
 
326
326
  txt << main_document.comments
327
327
 
328
- txt.select(&:present?).join("\n\n")
328
+ txt.compact_blank.join("\n\n")
329
329
  end
330
330
 
331
331
  def build_document_infos
@@ -1,3 +1,3 @@
1
- class Dorsale::BillingMachine::QuotationMultipleVatPdf < ::Dorsale::BillingMachine::InvoiceMultipleVatPdf
1
+ class Dorsale::BillingMachine::QuotationMultipleVatPdf < Dorsale::BillingMachine::InvoiceMultipleVatPdf
2
2
  include ::Dorsale::BillingMachine::QuotationPdfCommonMethods
3
3
  end
@@ -1,3 +1,3 @@
1
- class Dorsale::BillingMachine::QuotationSingleVatPdf < ::Dorsale::BillingMachine::InvoiceSingleVatPdf
1
+ class Dorsale::BillingMachine::QuotationSingleVatPdf < Dorsale::BillingMachine::InvoiceSingleVatPdf
2
2
  include ::Dorsale::BillingMachine::QuotationPdfCommonMethods
3
3
  end
@@ -34,11 +34,11 @@ class Dorsale::ExpenseGun::ExpensePdf < Dorsale::ApplicationPdf
34
34
 
35
35
  private
36
36
 
37
- def info(obj, attribute, helper: nil, **options)
37
+ def info(obj, attribute, helper: nil, **)
38
38
  key = obj.t(attribute)
39
39
  value = obj.public_send(attribute)
40
40
  value = helper ? H.public_send(helper, value) : value.to_s
41
- text "<b>#{key} :</b> #{value}", inline_format: true, **options
41
+ text("<b>#{key} :</b> #{value}", inline_format: true, **)
42
42
  end
43
43
 
44
44
  def table_data
@@ -13,8 +13,8 @@ module Dorsale::PrawnHelpers
13
13
  transparent(0.5) { stroke_bounds } if draw_debug_bounds?
14
14
  end
15
15
 
16
- def t(*args)
17
- I18n.t(*args)
16
+ def t(*)
17
+ I18n.t(*)
18
18
  end
19
19
 
20
20
  def page_height
@@ -19,7 +19,7 @@ class Dorsale::ApplicationPolicy
19
19
  end
20
20
 
21
21
  def self.inherited(klass)
22
- super(klass)
22
+ super
23
23
  klass.define_subject_accessor!
24
24
  end
25
25
 
@@ -1,4 +1,4 @@
1
- class Dorsale::BillingMachine::Invoice::Copy < ::Dorsale::Service
1
+ class Dorsale::BillingMachine::Invoice::Copy < Dorsale::Service
2
2
  attr_accessor :invoice, :copy
3
3
 
4
4
  def initialize(invoice)
@@ -26,7 +26,7 @@ class Dorsale::BillingMachine::Invoice::Statistics
26
26
  .sum
27
27
  end
28
28
 
29
- def t(*args)
30
- ::Dorsale::BillingMachine::Invoice.t(*args)
29
+ def t(*)
30
+ ::Dorsale::BillingMachine::Invoice.t(*)
31
31
  end
32
32
  end
@@ -1,4 +1,4 @@
1
- class Dorsale::BillingMachine::Quotation::Copy < ::Dorsale::Service
1
+ class Dorsale::BillingMachine::Quotation::Copy < Dorsale::Service
2
2
  attr_accessor :quotation, :copy
3
3
 
4
4
  def initialize(quotation)
@@ -29,7 +29,7 @@ class Dorsale::BillingMachine::Quotation::Statistics
29
29
  .sum
30
30
  end
31
31
 
32
- def t(*args)
33
- ::Dorsale::BillingMachine::Quotation.t(*args)
32
+ def t(*)
33
+ ::Dorsale::BillingMachine::Quotation.t(*)
34
34
  end
35
35
  end
@@ -1,4 +1,4 @@
1
- class Dorsale::BillingMachine::Quotation::ToInvoice < ::Dorsale::Service
1
+ class Dorsale::BillingMachine::Quotation::ToInvoice < Dorsale::Service
2
2
  attr_accessor :quotation, :invoice
3
3
 
4
4
  def initialize(quotation)
@@ -12,8 +12,8 @@ class Dorsale::BillingMachine::Quotation::ToInvoice < ::Dorsale::Service
12
12
  quotation.attributes.each do |k, v|
13
13
  next if ignored_key?(k)
14
14
 
15
- if invoice.respond_to?("#{k}=")
16
- invoice.public_send("#{k}=", v)
15
+ if invoice.respond_to?(:"#{k}=")
16
+ invoice.public_send(:"#{k}=", v)
17
17
  end
18
18
  end
19
19
 
@@ -23,8 +23,8 @@ class Dorsale::BillingMachine::Quotation::ToInvoice < ::Dorsale::Service
23
23
  quotation_line.attributes.each do |k, v|
24
24
  next if ignored_key?(k)
25
25
 
26
- if invoice_line.respond_to?("#{k}=")
27
- invoice_line.public_send("#{k}=", v)
26
+ if invoice_line.respond_to?(:"#{k}=")
27
+ invoice_line.public_send(:"#{k}=", v)
28
28
  end
29
29
  end
30
30
  end
@@ -1,4 +1,4 @@
1
- class Dorsale::ExpenseGun::Expense::Copy < ::Dorsale::Service
1
+ class Dorsale::ExpenseGun::Expense::Copy < Dorsale::Service
2
2
  attr_accessor :expense, :copy
3
3
 
4
4
  def initialize(expense)
@@ -1,4 +1,4 @@
1
- class Dorsale::Flyboy::Task::Copy < ::Dorsale::Service
1
+ class Dorsale::Flyboy::Task::Copy < Dorsale::Service
2
2
  attr_accessor :task, :copy
3
3
 
4
4
  def initialize(task)
@@ -1,4 +1,4 @@
1
- class Dorsale::Flyboy::Task::Snoozer < ::Dorsale::Service
1
+ class Dorsale::Flyboy::Task::Snoozer < Dorsale::Service
2
2
  attr_reader :task
3
3
 
4
4
  def initialize(task)
@@ -1,5 +1,5 @@
1
1
  class Dorsale::Service
2
- def self.call(*args)
3
- new(*args).call
2
+ def self.call(*)
3
+ new(*).call
4
4
  end
5
5
  end
@@ -1,4 +1,4 @@
1
- class Dorsale::TagListForModel < ::Dorsale::Service
1
+ class Dorsale::TagListForModel < Dorsale::Service
2
2
  attr_reader :model
3
3
 
4
4
  def initialize(model)
@@ -1,2 +1,2 @@
1
- class Dorsale::Alexandrie::FileUploader < ::Dorsale::ApplicationUploader
1
+ class Dorsale::Alexandrie::FileUploader < Dorsale::ApplicationUploader
2
2
  end
@@ -1,2 +1,2 @@
1
- class Dorsale::ApplicationUploader < ::ApplicationUploader
1
+ class Dorsale::ApplicationUploader < ApplicationUploader
2
2
  end
@@ -1,6 +1,6 @@
1
1
  require "mini_magick"
2
2
 
3
- class Dorsale::AvatarUploader < ::Dorsale::ImageUploader
3
+ class Dorsale::AvatarUploader < Dorsale::ImageUploader
4
4
  include CarrierWave::MiniMagick
5
5
 
6
6
  process resize_to_fill: [200, 200]
@@ -1,5 +1,5 @@
1
- class Dorsale::ImageUploader < ::Dorsale::ApplicationUploader
1
+ class Dorsale::ImageUploader < Dorsale::ApplicationUploader
2
2
  def extension_allowlist
3
- %w(jpg jpeg gif png)
3
+ %w[jpg jpeg gif png]
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
- class Dorsale::PdfUploader < ::Dorsale::ApplicationUploader
1
+ class Dorsale::PdfUploader < Dorsale::ApplicationUploader
2
2
  def extension_allowlist
3
- %w(pdf)
3
+ %w[pdf]
4
4
  end
5
5
  end
@@ -1,4 +1,4 @@
1
- fields = %w(
1
+ fields = %w[
2
2
  person_type
3
3
  first_name
4
4
  last_name
@@ -26,7 +26,7 @@ fields = %w(
26
26
  address.city
27
27
  address.zip
28
28
  address.country
29
- )
29
+ ]
30
30
 
31
31
  data = []
32
32
 
@@ -41,7 +41,7 @@ data << fields.map { |field| model.t(field) }
41
41
  elsif field.include?("address.")
42
42
  line << person.address.public_send(field.gsub("address.", ""))
43
43
  else
44
- line << person.public_send(:try, field)
44
+ line << person.try(field)
45
45
  end
46
46
  end
47
47
 
@@ -23,7 +23,7 @@ Given(/^an existing paid invoice$/) do
23
23
  end
24
24
 
25
25
  Given(/^billing machine in single vat mode$/) do
26
- ::Dorsale::BillingMachine.vat_mode = :single
26
+ Dorsale::BillingMachine.vat_mode = :single
27
27
  end
28
28
 
29
29
  Given(/^a bunch of existing invoices$/) do
@@ -149,7 +149,7 @@ When(/^he changes the advance to "(.*?)"€$/) do |value|
149
149
  end
150
150
 
151
151
  When(/^he goes to the newly created invoice page$/) do
152
- @invoice = ::Dorsale::BillingMachine::Invoice.last_created
152
+ @invoice = Dorsale::BillingMachine::Invoice.last_created
153
153
  visit dorsale.edit_billing_machine_invoice_path(@invoice)
154
154
  end
155
155
 
@@ -205,7 +205,7 @@ Then(/^it's added to the invoice list$/) do
205
205
  step("the user goes to the invoices page")
206
206
  expect(page).to have_selector ".invoice .date", text: @date
207
207
  # There are no other invoices for this test so we should get the right number
208
- tracking_id = ::Dorsale::BillingMachine::Invoice.first.tracking_id
208
+ tracking_id = Dorsale::BillingMachine::Invoice.first.tracking_id
209
209
  expect(page).to have_selector ".invoice .tracking_id", text: tracking_id
210
210
  expect(page).to have_selector ".invoice .customer_name", text: @customer.name
211
211
  expect(page).to have_selector ".invoice .total_excluding_taxes", text: "180,00 €"
@@ -1,5 +1,5 @@
1
1
  Given(/^billing machine in multiple vat mode$/) do
2
- ::Dorsale::BillingMachine.vat_mode = :multiple
2
+ Dorsale::BillingMachine.vat_mode = :multiple
3
3
  end
4
4
 
5
5
  When(/^he fills the reference, the date and the payment terms$/) do
@@ -18,7 +18,7 @@ end
18
18
 
19
19
  Given(/^(\d+) associated documents to this quotation$/) do |n|
20
20
  n.to_i.times do |i|
21
- instance_variable_set "@document#{i}", create(:alexandrie_attachment, attachable: @quotation)
21
+ instance_variable_set :"@document#{i}", create(:alexandrie_attachment, attachable: @quotation)
22
22
  end
23
23
  end
24
24
 
@@ -165,7 +165,7 @@ Then(/^he will see links to the documents$/) do
165
165
  end
166
166
 
167
167
  Then(/^the quotation informations are visible on the quotation details$/) do
168
- @quotation = ::Dorsale::BillingMachine::Quotation.last_created
168
+ @quotation = Dorsale::BillingMachine::Quotation.last_created
169
169
  visit dorsale.billing_machine_quotation_path(@quotation)
170
170
  expect(page).to have_content @payment_term.label
171
171
  expect(page).to have_content "I-am-a-comment"
@@ -182,7 +182,7 @@ Given(/^a closed task to this corporation$/) do
182
182
  end
183
183
 
184
184
  Given(/^a link between this individual and this corporation$/) do
185
- @link = ::Dorsale::CustomerVault::Link.create!(
185
+ @link = Dorsale::CustomerVault::Link.create!(
186
186
  :alice => @corporation,
187
187
  :bob => @individual,
188
188
  :title => "I-am-a-link",
@@ -203,14 +203,14 @@ Then(/^I am on the corporation page$/) do
203
203
  end
204
204
 
205
205
  When(/^I delete this corporation$/) do
206
- @corporations_count = ::Dorsale::CustomerVault::Corporation.count
206
+ @corporations_count = Dorsale::CustomerVault::Corporation.count
207
207
 
208
208
  find(".context [href$=edit]").click
209
209
  find(".context [data-method=delete]").click
210
210
  end
211
211
 
212
212
  Then(/^the corporation is deleted$/) do
213
- expect(::Dorsale::CustomerVault::Corporation.count).to eq(@corporations_count - 1)
213
+ expect(Dorsale::CustomerVault::Corporation.count).to eq(@corporations_count - 1)
214
214
  end
215
215
 
216
216
  Then(/^I am on the people page$/) do
@@ -3,7 +3,7 @@ When(/^I go on the tasks section$/) do
3
3
  end
4
4
 
5
5
  When(/^I create a task on this person$/) do
6
- @tasks_count = ::Dorsale::Flyboy::Task.count
6
+ @tasks_count = Dorsale::Flyboy::Task.count
7
7
  find("#context-main a[href*='tasks/new']").click
8
8
  fill_in :task_name, with: "YepYep"
9
9
  fill_in :task_description, with: "Trololo"
@@ -11,8 +11,8 @@ When(/^I create a task on this person$/) do
11
11
  end
12
12
 
13
13
  Then(/^the person task is created$/) do
14
- expect(::Dorsale::Flyboy::Task.count).to eq(@tasks_count + 1)
15
- @task = ::Dorsale::Flyboy::Task.last_created
14
+ expect(Dorsale::Flyboy::Task.count).to eq(@tasks_count + 1)
15
+ @task = Dorsale::Flyboy::Task.last_created
16
16
  person = @corporation || @individual || @person
17
17
  expect(current_path).to eq dorsale.tasks_customer_vault_person_path(person)
18
18
  end
@@ -23,7 +23,7 @@ require "axlsx"
23
23
 
24
24
  require "agilibox"
25
25
 
26
- if Rails.env.test? || Rails.env.development?
26
+ if Rails.env.local?
27
27
  require "pry"
28
28
  require "factory_bot_rails"
29
29
  require "factory_bot"
@@ -42,7 +42,7 @@ module Dorsale
42
42
  end
43
43
 
44
44
  initializer "factory_bot" do
45
- if Rails.env.test? || Rails.env.development?
45
+ if Rails.env.local?
46
46
  FactoryBot.definition_file_paths.unshift Dorsale::Engine.root.join("spec/factories/").to_s
47
47
  end
48
48
  end
@@ -54,13 +54,13 @@ module Dorsale
54
54
  end
55
55
 
56
56
  config.after_initialize do
57
- Dorsale::PolicyChecker.check! if Rails.env.test? || Rails.env.development?
57
+ Dorsale::PolicyChecker.check! if Rails.env.local?
58
58
  end
59
59
 
60
60
  initializer "assets" do
61
- Rails.application.config.assets.precompile += %w(
61
+ Rails.application.config.assets.precompile += %w[
62
62
  dorsale/avatar.png
63
- )
63
+ ]
64
64
  end
65
65
 
66
66
  initializer "simple_form" do
@@ -1,3 +1,3 @@
1
1
  module Dorsale
2
- VERSION = "4.0.0"
2
+ VERSION = "4.1.0"
3
3
  end
@@ -133,7 +133,7 @@ describe Dorsale::Alexandrie::AttachmentsController, type: :controller do
133
133
  it "should delete attachment" do
134
134
  expect {
135
135
  delete :destroy, params: {id: attachment}
136
- }.to change(::Dorsale::Alexandrie::Attachment, :count).by(-1)
136
+ }.to change(Dorsale::Alexandrie::Attachment, :count).by(-1)
137
137
  end
138
138
 
139
139
  it "should render list" do
@@ -1,6 +1,6 @@
1
1
  require "rails_helper"
2
2
 
3
- describe ::Dorsale::CustomerVault::EventsController, type: :controller do
3
+ describe Dorsale::CustomerVault::EventsController, type: :controller do
4
4
  routes { Dorsale::Engine.routes }
5
5
 
6
6
  let(:user) { create(:user) }
@@ -1,6 +1,6 @@
1
1
  require "rails_helper"
2
2
 
3
- RSpec.describe ::Dorsale::CustomerVault::PeopleController, type: :controller do
3
+ RSpec.describe Dorsale::CustomerVault::PeopleController, type: :controller do
4
4
  routes { Dorsale::Engine.routes }
5
5
 
6
6
  let(:user) { create(:user) }
@@ -1,6 +1,6 @@
1
1
  require "rails_helper"
2
2
 
3
- RSpec.describe ::Dorsale::ExpenseGun::ExpensesController, type: :controller do
3
+ RSpec.describe Dorsale::ExpenseGun::ExpensesController, type: :controller do
4
4
  routes { Dorsale::Engine.routes }
5
5
  let(:user) { create(:user) }
6
6
  before(:each) { sign_in(user) }
@@ -1,5 +1,5 @@
1
1
  FactoryBot.define do
2
- factory :alexandrie_attachment_type, class: ::Dorsale::Alexandrie::AttachmentType do
2
+ factory :alexandrie_attachment_type, class: Dorsale::Alexandrie::AttachmentType do
3
3
  name { Faker::Lorem.words.join(" ") }
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  FactoryBot.define do
2
- factory :alexandrie_attachment, class: ::Dorsale::Alexandrie::Attachment do
2
+ factory :alexandrie_attachment, class: Dorsale::Alexandrie::Attachment do
3
3
  attachable {
4
4
  DummyModel.create!(name: "abc")
5
5
  }
@@ -1,5 +1,5 @@
1
1
  FactoryBot.define do
2
- factory :billing_machine_invoice_line, class: ::Dorsale::BillingMachine::InvoiceLine do
2
+ factory :billing_machine_invoice_line, class: Dorsale::BillingMachine::InvoiceLine do
3
3
  invoice { create(:billing_machine_invoice) }
4
4
  label { "Invoice line" + Faker::Lorem.words.join(" ") }
5
5
  quantity { 10 }
@@ -1,5 +1,5 @@
1
1
  FactoryBot.define do
2
- factory :billing_machine_invoice, class: ::Dorsale::BillingMachine::Invoice do
2
+ factory :billing_machine_invoice, class: Dorsale::BillingMachine::Invoice do
3
3
  customer { create(:customer_vault_corporation) }
4
4
  payment_term { create(:billing_machine_payment_term) }
5
5
  date { "2014-02-19" }
@@ -1,5 +1,5 @@
1
1
  FactoryBot.define do
2
- factory :billing_machine_payment_term, class: ::Dorsale::BillingMachine::PaymentTerm do
2
+ factory :billing_machine_payment_term, class: Dorsale::BillingMachine::PaymentTerm do
3
3
  label { "Payment term " + Faker::Lorem.words.join(" ") }
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  FactoryBot.define do
2
- factory :billing_machine_quotation_line, class: ::Dorsale::BillingMachine::QuotationLine do
2
+ factory :billing_machine_quotation_line, class: Dorsale::BillingMachine::QuotationLine do
3
3
  quotation { create(:billing_machine_quotation) }
4
4
  label { "Quotation line" + Faker::Lorem.words.join(" ") }
5
5
  quantity { 10 }
@@ -1,5 +1,5 @@
1
1
  FactoryBot.define do
2
- factory :billing_machine_quotation, class: ::Dorsale::BillingMachine::Quotation do
2
+ factory :billing_machine_quotation, class: Dorsale::BillingMachine::Quotation do
3
3
  customer { create(:customer_vault_corporation) }
4
4
  payment_term { create(:billing_machine_payment_term) }
5
5
  date { "2014-02-19" }
@@ -1,5 +1,5 @@
1
1
  FactoryBot.define do
2
- factory :customer_vault_activity_type, class: ::Dorsale::CustomerVault::ActivityType do
2
+ factory :customer_vault_activity_type, class: Dorsale::CustomerVault::ActivityType do
3
3
  name { Faker::Lorem.word }
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  FactoryBot.define do
2
- factory :customer_vault_corporation, class: ::Dorsale::CustomerVault::Corporation do
2
+ factory :customer_vault_corporation, class: Dorsale::CustomerVault::Corporation do
3
3
  activity_type { create(:customer_vault_activity_type) }
4
4
  origin { create(:customer_vault_origin) }
5
5
  name { "#{Faker::Company.name} #{Faker::Company.suffix}" }
@@ -1,5 +1,5 @@
1
1
  FactoryBot.define do
2
- factory :customer_vault_event, class: ::Dorsale::CustomerVault::Event do
2
+ factory :customer_vault_event, class: Dorsale::CustomerVault::Event do
3
3
  author { build(:user) }
4
4
  person { build(:customer_vault_corporation) }
5
5
  action { "create" }
@@ -1,5 +1,5 @@
1
1
  FactoryBot.define do
2
- factory :customer_vault_individual, class: ::Dorsale::CustomerVault::Individual do
2
+ factory :customer_vault_individual, class: Dorsale::CustomerVault::Individual do
3
3
  origin { create(:customer_vault_origin) }
4
4
  first_name { Faker::Name.first_name }
5
5
  last_name { Faker::Name.last_name }
@@ -1,5 +1,5 @@
1
1
  FactoryBot.define do
2
- factory :customer_vault_link, class: ::Dorsale::CustomerVault::Link do
2
+ factory :customer_vault_link, class: Dorsale::CustomerVault::Link do
3
3
  association :alice, factory: :customer_vault_individual
4
4
  association :bob, factory: :customer_vault_corporation
5
5
  title { "Manager" }
@@ -1,5 +1,5 @@
1
1
  FactoryBot.define do
2
- factory :customer_vault_origin, class: ::Dorsale::CustomerVault::Origin do
2
+ factory :customer_vault_origin, class: Dorsale::CustomerVault::Origin do
3
3
  name { Faker::Lorem.word }
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  FactoryBot.define do
2
- factory :dorsale_address, class: ::Dorsale::Address do
2
+ factory :dorsale_address, class: Dorsale::Address do
3
3
  street { "3 Rue Marx Dormoy" }
4
4
  street_bis { "1er étage" }
5
5
  city { "Marseille" }
@@ -1,5 +1,5 @@
1
1
  FactoryBot.define do
2
- factory :dorsale_comment, class: ::Dorsale::Comment do
2
+ factory :dorsale_comment, class: Dorsale::Comment do
3
3
  commentable { create(:customer_vault_corporation) }
4
4
  author { create(:user) }
5
5
  text { Faker::Lorem.paragraph }
@@ -1,5 +1,5 @@
1
1
  FactoryBot.define do
2
- factory :expense_gun_category, class: ::Dorsale::ExpenseGun::Category do
2
+ factory :expense_gun_category, class: Dorsale::ExpenseGun::Category do
3
3
  name { Faker::Lorem.word }
4
4
  code { Faker::Number.number(digits: 4) }
5
5
  vat_deductible { [true, false].sample }
@@ -1,5 +1,5 @@
1
1
  FactoryBot.define do
2
- factory :expense_gun_expense_line, class: ::Dorsale::ExpenseGun::ExpenseLine do
2
+ factory :expense_gun_expense_line, class: Dorsale::ExpenseGun::ExpenseLine do
3
3
  expense { build(:expense_gun_expense) }
4
4
  name { Faker::Lorem.sentence(word_count: 3) }
5
5
  category { build(:expense_gun_category) }
@@ -1,5 +1,5 @@
1
1
  FactoryBot.define do
2
- factory :expense_gun_expense, class: ::Dorsale::ExpenseGun::Expense do
2
+ factory :expense_gun_expense, class: Dorsale::ExpenseGun::Expense do
3
3
  name { Faker::Lorem.sentence(word_count: 3) }
4
4
  date { Date.current }
5
5
  user { create(:user) }
@@ -1,5 +1,5 @@
1
1
  FactoryBot.define do
2
- factory :flyboy_task_comment, class: ::Dorsale::Flyboy::TaskComment do
2
+ factory :flyboy_task_comment, class: Dorsale::Flyboy::TaskComment do
3
3
  task { create(:flyboy_task) }
4
4
  date { Time.zone.now }
5
5
  progress { 95 }
@@ -1,5 +1,5 @@
1
1
  FactoryBot.define do
2
- factory :flyboy_task, class: ::Dorsale::Flyboy::Task do
2
+ factory :flyboy_task, class: Dorsale::Flyboy::Task do
3
3
  name { "I-am-a-task#{Kernel.rand(1_000..9_999)}" }
4
4
  description { "I-am-the-task-description_#{Kernel.rand(1_000..9_999)}" }
5
5
  progress { Kernel.rand(0..99) }