comee_core 0.3.40 → 0.3.41

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 678327a5ca4eac8095260552f753d2e1a7e67bf9f8dc6da4f09647d30dfceb62
4
- data.tar.gz: 4a3e117d73a6a1be6a7fe9124abfda613940d9e5b68aef3f83e9f14a9664b5c2
3
+ metadata.gz: 945ebcfda26158faf04eeb992d73078a05ece14bf999e93287d4f9a40a536f3e
4
+ data.tar.gz: b85605bbe210dafc52a8f1e0f29f572c5ee258cbc65bfa11bfaee65ab88edcc3
5
5
  SHA512:
6
- metadata.gz: bee75f2697ec18163a2e1f98be4be925c0f6693c3fa4e7a8081d1c614d15c03f433face6a2666f4ae704a6fbed7bec88f6da0ed9e709abac04cd3563402e64b6
7
- data.tar.gz: 3893670eb9c952b15e3d2aec27d162ae26ba01b4ba527453d305b303e1303e572365c23d99405b63bda719fd6853f6492102e5daa071b1559bdfd03220392081
6
+ metadata.gz: 1c67e379c9ae392240d543c73a99cb89f3084db1648df9ad2310fb5054589fb32a1cb8ab4a2270f1ceaa7f9eefcb018a19cf3c5d56c15de8b0ebb414f6048c76
7
+ data.tar.gz: 6d7578c2ebbf76fcba4ecf48e4ee43130f30a9b73ed5bd83d53e4cffafeb1d8f95dd4dbfbd451edbca971a4722cad75f5c55a8b3dea33aa8373b359ba0f349bf
@@ -5,7 +5,7 @@ module Comee
5
5
  after_save :update_invoice
6
6
  after_destroy :update_invoice
7
7
 
8
- belongs_to :shipment_instruction_item
8
+ belongs_to :invoiceable, polymorphic: true
9
9
  belongs_to :invoice
10
10
  belongs_to :unit
11
11
 
@@ -0,0 +1,20 @@
1
+ class ChangeReferenceInInvoiceToPolymorphic < ActiveRecord::Migration[7.1]
2
+ def change
3
+ add_reference :comee_core_invoice_items,
4
+ :invoiceable,
5
+ polymorphic: true,
6
+ index: {name: "invoiceable_on_ccii_indx"}
7
+ reversible do |dir|
8
+ dir.up do
9
+ execute <<-SQL.squish
10
+ UPDATE comee_core_invoice_items
11
+ SET invoiceable_type = 'Comee::Core::ShipmentInstructionItem',
12
+ invoiceable_id = shipment_instruction_item_id
13
+ SQL
14
+ end
15
+ end
16
+ remove_reference :comee_core_invoice_items,
17
+ :shipment_instruction_item,
18
+ foreign_key: {to_table: :comee_core_shipment_instruction_items}
19
+ end
20
+ end
@@ -1,5 +1,5 @@
1
1
  module Comee
2
2
  module Core
3
- VERSION = "0.3.40".freeze
3
+ VERSION = "0.3.41".freeze
4
4
  end
5
5
  end
@@ -1,6 +1,6 @@
1
1
  FactoryBot.define do
2
2
  factory :invoice_item, class: "Comee::Core::InvoiceItem" do
3
- shipment_instruction_item
3
+ invoiceable factory: :shipment_instruction_item
4
4
  unit
5
5
  quantity { 10 }
6
6
  unit_price { 5 }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: comee_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.40
4
+ version: 0.3.41
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henock L.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-02 00:00:00.000000000 Z
11
+ date: 2024-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_model_serializers
@@ -534,6 +534,7 @@ files:
534
534
  - db/migrate/20240731075328_create_comee_core_credit_notes.rb
535
535
  - db/migrate/20240731080746_create_comee_core_credit_note_items.rb
536
536
  - db/migrate/20240731081502_create_comee_core_credit_note_additional_items.rb
537
+ - db/migrate/20240803194006_change_reference_in_invoice_to_polymorphic.rb
537
538
  - lib/comee/core.rb
538
539
  - lib/comee/core/engine.rb
539
540
  - lib/comee/core/version.rb