eitil 1.3.8 → 1.3.9

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: 62c186ffdd14894a3ed5ce9d6a635030821ab1bdc86aa5ad7f35c7d1a3592dca
4
- data.tar.gz: b53791e40cd28e1f6435e9cbc2888c57e26ca6f5d05b3cb3518f7285a6311618
3
+ metadata.gz: 800a7394bf32ae0a35ac26f8af1f854f90161acc373a3cc346422bb71ff58652
4
+ data.tar.gz: '04928eaebb9da031a756d431a2b76893c7d69f9084c48da9066631337014510b'
5
5
  SHA512:
6
- metadata.gz: 869d88f962e7a688b203d0f5e89132ce5f343975d6ce1a0c926691454027c5935073086766c5d0febb28be0108ca8a183f106cfb32b8314f50046dbffd6d68c7
7
- data.tar.gz: 3ebe01d21f32cc00c3e9c84b9937b71d9e1aa46590f5b0384c18d28e0a1d6706a161cab34c58bdb2a0b59c2a8883dcf1371bcd928f645b8c6fadcdd6057143c4
6
+ metadata.gz: 07b716769dec7ee55df77d28a4d4fda783868f931f50f8ff44caaa28b28a614c08496ddb1b3c1f6035a4ca6a7ffe98e96547bad2d75872ae5ce3fb20d96b5fa9
7
+ data.tar.gz: 6795a24f73771f86e40a774cb0ab409288eba5b1e82b5b1e97983fd273ee186d6dda22dac75ee99701e3e321c83b855950fc0e156a877f1f1c62aaaa9b664b37
@@ -254,7 +254,10 @@ Calculators are generated through the columns of your model's database table. Wh
254
254
  # require "eitil_wrapper/scopes/default_scopes"
255
255
 
256
256
  # columns of datatype: array (serialized)
257
- .{column_name}_sum # returns all uniq elements in a new, single array
257
+ .{column_name}_sum # returns all uniq elements in a new, single array
258
+ .{column_name}_sum_i # sum and map to integer
259
+ .{column_name}_sum_f # sum and map to float
260
+ .{column_name}_sum_d # sum and map to decimal
258
261
 
259
262
  # columns of datatype: integer
260
263
  .{column_name}_max
@@ -18,7 +18,10 @@ module EitilWrapper
18
18
  }
19
19
 
20
20
  SharableIterableCalculators = -> (_class, column) {
21
- _class.eitil_calculator :"#{column}_sum", -> { _class.pluck(column).flatten!.uniq! }
21
+ _class.eitil_calculator :"#{column}_sum", -> { _class.pluck(column).flatten!.uniq! }
22
+ _class.eitil_calculator :"#{column}_sum_i", -> { _class.pluck(column).flatten!.uniq!.map(&:to_i) }
23
+ _class.eitil_calculator :"#{column}_sum_f", -> { _class.pluck(column).flatten!.uniq!.map(&:to_f) }
24
+ _class.eitil_calculator :"#{column}_sum_d", -> { _class.pluck(column).flatten!.uniq!.map(&:to_d) }
22
25
  }
23
26
 
24
27
  def inherited(subclass)
data/lib/eitil/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Eitil
2
2
 
3
- VERSION = '1.3.8'
3
+ VERSION = '1.3.9'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eitil
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.8
4
+ version: 1.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jurriaan Schrofer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-05 00:00:00.000000000 Z
11
+ date: 2021-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails