cats_core 1.4.11 → 1.4.12

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: 76ca8cc4de9fdcbcc3f6a6b183fe9a8ec3b207e9fe0d60433a173eb854c9e482
4
- data.tar.gz: 39c1d04223ff01f1d0ada3fc7b9587b2b0db778dd8e7d113ac262359dc8cbf2b
3
+ metadata.gz: 3724badb244476dc73d7c35fac9971114160be9781ba3a386f2d35ef70226324
4
+ data.tar.gz: 9f29cd5757d75472e03f8baa3bd4421fc78109d50612955ebdd666a354c17ca6
5
5
  SHA512:
6
- metadata.gz: e8b3bfbdf2c3f776f9a00c46453c7e720e217ca5a092e938371d256bd10f2f5751832464c73622a75728bc70e6588069125c2560308e1400b8e8fe3aa55a0427
7
- data.tar.gz: '0768b2e8680b04b02293061ab4eb1adb884657c21c29457adca4c56f4c4583572784495bde0c09e0d52779c9ec59e1db426d4c0e8769b0f867759820bb494a0b'
6
+ metadata.gz: e5a859815e6420692ab833b54372ae47c0fbf835b8384c8d18421eadb79125deb3a2c91ae740dfb9abe1817bf7e01e45cc14312e94d95aaadaade3e767a64dfe
7
+ data.tar.gz: a85113ab315551f8684accc9d21345b684d9762c73bfc44538bf6d8ac30a4d8e1f2aea24620fc0ebdee000f97de0ae18745b72a28a68cb6f44f6e3b9b184b209
@@ -7,9 +7,10 @@ module Cats
7
7
 
8
8
  belongs_to :transport_requisition
9
9
  belongs_to :prepared_by, class_name: 'Cats::Core::User'
10
- belongs_to :approved_by, class_name: 'Cats::Core::User'
10
+ belongs_to :approved_by, class_name: 'Cats::Core::User', optional: true
11
11
 
12
12
  validates :status, presence: true, inclusion: { in: STATUSES }
13
+ validates :order_date, presence: true
13
14
  validate :validate_against_requisition
14
15
 
15
16
  def validate_against_requisition
@@ -6,7 +6,7 @@ module Cats
6
6
  belongs_to :transport_requisition_item
7
7
  belongs_to :transport_contract, optional: true
8
8
 
9
- validates :order_date, :valid_for, presence: true
9
+ validates :valid_for, presence: true
10
10
  validates :valid_for, numericality: { greater_than: 0 }
11
11
  validates :transport_requisition_item_id, uniqueness: true
12
12
  validate :validate_requisition
@@ -10,9 +10,10 @@ class CreateCatsCoreTransportOrders < ActiveRecord::Migration[7.0]
10
10
  index: { name: 'pb_on_to_indx' },
11
11
  foreign_key: { to_table: :cats_core_users }
12
12
  t.references :approved_by,
13
- null: false,
13
+ null: true,
14
14
  index: { name: 'ab_on_to_indx' },
15
15
  foreign_key: { to_table: :cats_core_users }
16
+ t.date :order_date, null: false
16
17
  t.string :status, null: false, default: 'Draft'
17
18
 
18
19
  t.timestamps
@@ -17,7 +17,6 @@ class CreateCatsCoreTransportOrderItems < ActiveRecord::Migration[7.0]
17
17
  null: false,
18
18
  index: { name: 'tri_on_toi_indx' },
19
19
  foreign_key: { to_table: :cats_core_transport_requisition_items }
20
- t.date :order_date, null: false, default: Date.today
21
20
  t.integer :valid_for, null: false, default: 10
22
21
 
23
22
  t.timestamps
@@ -1,5 +1,5 @@
1
1
  module Cats
2
2
  module Core
3
- VERSION = '1.4.11'.freeze
3
+ VERSION = '1.4.12'.freeze
4
4
  end
5
5
  end
@@ -4,7 +4,6 @@ FactoryBot.define do
4
4
  transporter
5
5
  transport_contract
6
6
  transport_requisition_item { transport_order.transport_requisition.transport_requisition_items.first }
7
- order_date { Date.today }
8
7
  valid_for { 10 }
9
8
  end
10
9
  end
@@ -3,6 +3,7 @@ FactoryBot.define do
3
3
  association :transport_requisition, :approved
4
4
  prepared_by factory: :user
5
5
  approved_by factory: :user
6
+ order_date { Date.today }
6
7
  status { Cats::Core::TransportOrder::DRAFT }
7
8
  end
8
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cats_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.11
4
+ version: 1.4.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henock L.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-09 00:00:00.000000000 Z
11
+ date: 2022-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_model_serializers