cats_core 1.0.41 → 1.0.42

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: 1a3d6fa190673652349c149ea87b314da07a74f00c600d774f2911ca4da24a35
4
- data.tar.gz: 7c29148233b0fc4a2e9efc1c114cb02910967d679420cfa5f40aca7eb0a92083
3
+ metadata.gz: 459a3f07d1fadf11fb8120f91ecf18b2df1b7719e05a2e8398e0af664af1b19b
4
+ data.tar.gz: 92645ac2384a08e79db744e98e8179bcea78112c538c1b6444bbc0a6fa26d34e
5
5
  SHA512:
6
- metadata.gz: f37e6d2c1f1ff4d5c75df983a259c739d65de04d8d6da3f853dbe8994133f9ec7779c7b0948130ec9081e7127de062287271aa69703f0c5aa790588af6110a58
7
- data.tar.gz: 7b4f03e36d240e6ae05d04f46c9cef15f9ec86c0cf6f1bbc871eda27fa5f5d5cd9d0971f016a55ef97e8a7b71413d88ec9d1d156bb376506ad8e68e57be83d21
6
+ metadata.gz: 265613d922d768384446ca0e38e3dfcae4ae2bb9f07a7f8a278ebbc3f2ec87fd8c96f08ae08a5ecc605ee9903701bf8d90f45ba5583524717b65f97ad3264509
7
+ data.tar.gz: 3a8236f40c2f028c8a7cff2abcf2d08c02eb598f577e71bedf8723841301c70cf0f8c0834d36fc1eff6b6a06dca0c6383d5e06e8bdfbed6b82ee747176ca9792
@@ -46,7 +46,7 @@ module Cats
46
46
  end
47
47
 
48
48
  def model_params
49
- params.require(:payload).permit(:name, :location_type, :description, :parent_id)
49
+ params.require(:payload).permit(:code, :name, :location_type, :description, :parent_id)
50
50
  end
51
51
  end
52
52
  end
@@ -12,7 +12,8 @@ module Cats
12
12
 
13
13
  has_ancestry
14
14
 
15
- validates :name, :location_type, presence: true
15
+ validates :code, :name, :location_type, presence: true
16
+ validates :code, uniqueness: true
16
17
  validates :location_type, inclusion: { in: LOCATION_TYPES }
17
18
  validate :validate_location_parent
18
19
 
@@ -1,6 +1,7 @@
1
1
  class CreateCatsCoreLocations < ActiveRecord::Migration[6.1]
2
2
  def change
3
3
  create_table :cats_core_locations do |t|
4
+ t.string :code, unique: true
4
5
  t.string :name, null: false
5
6
  t.string :location_type, null: false
6
7
  t.string :description
@@ -1,5 +1,5 @@
1
1
  module Cats
2
2
  module Core
3
- VERSION = '1.0.41'.freeze
3
+ VERSION = '1.0.42'.freeze
4
4
  end
5
5
  end
@@ -1,5 +1,6 @@
1
1
  FactoryBot.define do
2
2
  factory :location, class: 'Cats::Core::Location', aliases: [:parent] do
3
+ code { FFaker::Name.name }
3
4
  name { FFaker::Name.name }
4
5
  location_type { Cats::Core::Location::REGION }
5
6
  ancestry { nil }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cats_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.41
4
+ version: 1.0.42
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henock L.