comee_core 0.1.73 → 0.1.74

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: f70459330a344373488a24814acd99ac3fd15fd2cd43e8b0da1cb54c4b0d21bb
4
- data.tar.gz: 1fe0179e6032e06ed07bf1a5906c6778565f820d1d895af35a60ab4287b8dc43
3
+ metadata.gz: f2186d3622f2ec54668695b7e4f9b72a2fa2e8803457719e47ec808a681fb9a0
4
+ data.tar.gz: 4f6d0e55625b309271ae845972da99774e0eeca64ada41f53b98e733822b99a8
5
5
  SHA512:
6
- metadata.gz: 3be550687705bb1d04341c3bc238f417ab8d525a34fa7aa3bdc79a7ec297d6f56d46bb3ca68b8b2f1e135252a3d9386abb8184a1749816faef1531063ea40312
7
- data.tar.gz: f343407146e4014597855c58879eddfb0788e3efd0e450590e6b486ef9c9ec909737c491525d5d1e53c74c42389a9e09fb7085df02464dd2b16275eef54248e4
6
+ metadata.gz: 2e5883953674469a3aca2e14e2e00a5837198198999d32619ac9a866aa2f29b49aefc6ea1d7ef0374294e7156dacc59a9395781925157abfc2fd0a5c3e532673
7
+ data.tar.gz: 6b15d9c4eeaa6e509a03cd2aeba69f369344a6067302bd8ad46c250d3c2c8e097c1a350309fb7bd058234d481c269198affbc8ace31769074e13da8e5cc33782
@@ -12,6 +12,7 @@ module Comee
12
12
 
13
13
  def filter
14
14
  @client_prices = Comee::Core::ClientPrice.includes(:client, :product, :unit).ransack(params[:q]).result
15
+ total = @client_prices.count
15
16
  @client_prices = @client_prices.then(&paginate)
16
17
  queries = @client_prices.map { |cp| {itemable_id: cp.client_id, product_id: cp.product_id, itemable_type: "Comee::Core::Client"} }
17
18
 
@@ -53,8 +54,13 @@ module Comee
53
54
  end
54
55
  res << item
55
56
  end
56
-
57
- render json: {success: true, data: result}
57
+ result = {success: true, data: result}
58
+ page = params[:page]
59
+ if page
60
+ result[:page] = page
61
+ result[:total] = total
62
+ end
63
+ render json: result
58
64
  end
59
65
 
60
66
  private
@@ -33,6 +33,10 @@ module Comee
33
33
  %w[code name description]
34
34
  end
35
35
 
36
+ def self.ransackable_associations(_auth_object = nil)
37
+ []
38
+ end
39
+
36
40
  def default_unit
37
41
  preferred_units.find { |unit| unit["default"] }
38
42
  end
@@ -1,5 +1,5 @@
1
1
  module Comee
2
2
  module Core
3
- VERSION = "0.1.73".freeze
3
+ VERSION = "0.1.74".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.73
4
+ version: 0.1.74
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-01-02 00:00:00.000000000 Z
11
+ date: 2024-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_model_serializers