comee_core 0.1.34 → 0.1.36

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: 853a41c0984f1e95455e14a73caf7c2465a675876e82401cbadb6a000df33d91
4
- data.tar.gz: 30b4c242623351a53bb145f4d0138fe08d365a4f71b0edc0119696b6d09cb014
3
+ metadata.gz: 0073a3f0100eb17a82500a1ae15c6cc118262be70542bfc516b662990da3de40
4
+ data.tar.gz: 70e6fc9c160b2f499c039e9697832980666ac5746493dab5f604d6e1ee6e51e6
5
5
  SHA512:
6
- metadata.gz: ba8920d5865d71fc83015e1fdb804f240f466cb8322b32ff4686777d85a2f846f2ab8110050d9250374466bb666eb44502218b199c2f8de3fbac0b4fe201d38b
7
- data.tar.gz: ed154ae6376c7a9ba14523cf71bac1a657c1a47301c677db656f05cda38da9f1dd80ab732ab68c78035124f265f389630737d210187d24f07b1a5696f10b923f
6
+ metadata.gz: 4232e5d33dd769a1021f9e607d4016ed77f75bb1e6a60ed408be97a3b7b03ef7e077906f067b65c77e2689f52d3a1a7bded880661fd9166e9d319c87ac5d95b0
7
+ data.tar.gz: 9dc773b6faeec9c77ac2b8f35d76e576ca614ce8bd5159a45f55cc30aa01a11a8591d041239de98199cae732153911ea71c266f1a7ee3fea8adff7b2fcd7c137
@@ -18,7 +18,7 @@ module Comee
18
18
  private
19
19
 
20
20
  def model_params
21
- params.require(:payload).permit(:valid_from, :valid_to, :price, :status, :product_id, :discount, :client_id, :previous_price,
21
+ params.require(:payload).permit(:valid_from, :valid_to, :price, :product_id, :discount, :client_id, :previous_price,
22
22
  :unit_id)
23
23
  end
24
24
  end
@@ -15,8 +15,8 @@ module Comee
15
15
  def validate_primary_price
16
16
  return unless product && primary
17
17
 
18
- count = MasterPrice.where(product: product, primary: true, status: Price.statuses[:current]).count
19
- return unless count.positive? && primary && MasterPrice.statuses[status] == MasterPrice.statuses[:current]
18
+ price = MasterPrice.find_by(product: product, primary: true, status: Price.statuses[:current])
19
+ return unless price && primary && price.id != id
20
20
 
21
21
  errors.add(:base, "There is already a primary price entry for item '#{product.code}'")
22
22
  end
@@ -1,5 +1,5 @@
1
1
  module Comee
2
2
  module Core
3
- VERSION = "0.1.34".freeze
3
+ VERSION = "0.1.36".freeze
4
4
  end
5
5
  end
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.1.34
4
+ version: 0.1.36
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henock L.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-10 00:00:00.000000000 Z
11
+ date: 2023-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_model_serializers