cats_core 1.0.25 → 1.0.26
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f7140f7b94aaf47e0b5cfcb9ad89515a6884a6f59c685d7bf3b10978d2239e8
|
4
|
+
data.tar.gz: d10e11f6f3506f4513921bb85814d1303bea873558c8603241b87df4474aa777
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a63abe18b61954481d0e758aa4a714bc201d2270febe2b86c157806c8ba9a7dafc44399177079fe5bf5bfed3dc916634cfae1a711ab3030ee8c2a95cc9c514a
|
7
|
+
data.tar.gz: 0ec75ce43af82a2dd05e1b3d7836893e273741c7cbb2bc074e49582cf0231b9105d8e4d9b0f0d44a08760dd40cb9bdd83e8b1bbcb4dbbce47ae3711417de64d1
|
@@ -16,6 +16,7 @@ module Cats
|
|
16
16
|
|
17
17
|
belongs_to :unit_of_measure
|
18
18
|
belongs_to :source, polymorphic: true
|
19
|
+
belongs_to :commodity_category
|
19
20
|
|
20
21
|
validates :best_use_before, presence: true
|
21
22
|
validates :batch_no, presence: true, uniqueness: true
|
@@ -23,6 +24,9 @@ module Cats
|
|
23
24
|
validates :volume_per_metric_ton, numericality: { greater_than: 0, allow_nil: true }
|
24
25
|
validates :arrival_status, presence: true, inclusion: { in: ARRIVAL_STATUSES }
|
25
26
|
|
27
|
+
delegate(:abbreviation, to: :unit_of_measure, prefix: true)
|
28
|
+
delegate(:name, to: :commodity_category, prefix: true)
|
29
|
+
|
26
30
|
def set_approved
|
27
31
|
return unless new_record?
|
28
32
|
|
@@ -6,6 +6,10 @@ class CreateCatsCoreCommodities < ActiveRecord::Migration[6.1]
|
|
6
6
|
null: false,
|
7
7
|
index: { name: 'uom_on_commodities_indx' },
|
8
8
|
foreign_key: { to_table: :cats_core_unit_of_measures }
|
9
|
+
t.references :commodity_category,
|
10
|
+
null: false,
|
11
|
+
index: { name: 'cc_on_commodities_indx' },
|
12
|
+
foreign_key: { to_table: :cats_core_commodity_categories }
|
9
13
|
t.references :source, polymorphic: true
|
10
14
|
t.float :quantity, null: false
|
11
15
|
t.string :description
|
data/lib/cats/core/version.rb
CHANGED