eitil 1.1.10 → 1.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d5c1c1ee54335f5ad56dd65d816c372052e0b02be349300d15a47a47408a017f
4
- data.tar.gz: e1b373a202a34300f4b877e2ab89a6f28d739a40cf923ba61fd4ea507e370c83
3
+ metadata.gz: 9169ee405f0792178972ef43031a8b55964a86e48eb99ec64732244726d2bdc5
4
+ data.tar.gz: b6886726f1057ffbbd7eb16826f770abbe47c6f9367d3d130f6a6ab14d98b892
5
5
  SHA512:
6
- metadata.gz: 6fe74d9b49355983dc8f6ef637493181e5865d75d180f07f9ca841118e39f3bd07da1fdc75c35522c6372bf51ca83aefbfb2e2d20d5b92ce80b0d9dbbc1d494f
7
- data.tar.gz: e001e4b2972ac791ddc6e342ce1bf9677272186627798b927b8200dbb32329ab17313afa3492b5b7c4ecfda549ee4dd22b3173343642d8946809766a8dda852a
6
+ metadata.gz: '0945980b87480c770a183030185edfa08b2f376a696bf0c5df688ac1908bfbc7690f23b2af0856089a3f322cb3256f416a08391378867d2bbfa3ab7ca0ff566a'
7
+ data.tar.gz: f4ecc28c0ad65ad1ec2572d11e82ffc3b212f83b74a5b1b5eb5a04aca8efa66134e8729f5913d050cdaad7cc5d5524f63b2af54957a422f37b1a0a4977e35a4f
@@ -7,7 +7,12 @@ class Array
7
7
 
8
8
  def to_relation
9
9
 
10
- return self unless self.present?
10
+ # Return an empty ActiveRecord_Relation instance when no objects are present,
11
+ # instead of returning the empty array itself. The reason being, that when you
12
+ # always return an association, you won't run into problems with undefined methods
13
+ # called later on, expecting an association instead of an array.
14
+
15
+ return ApplicationRecord.none unless self.present?
11
16
 
12
17
  unless self.all? { |item| item.class.ancestors.include? ApplicationRecord }
13
18
  raise_error "InvalidArrayError", ".to_relation requires that all array items are model instances"
@@ -9,7 +9,7 @@ Kernel.module_eval do
9
9
  suffix = suffix || DateTime.now.prettify
10
10
  file_type = file_type || "json"
11
11
 
12
- if file_type = "json"
12
+ if file_type == "json"
13
13
  data = JSON.pretty_generate(data)
14
14
  end
15
15
 
@@ -34,18 +34,26 @@ module EitilIntegrate::RubyXL
34
34
 
35
35
  end
36
36
 
37
- # parsing times into maxes (60 m, 24 h, days)
38
- th += tm / 60
39
- tm = tm % 60
40
- td += th / 24
41
- th = th % 24
42
-
43
- # formatting strings
44
- sd = td.to_s
37
+ # ALERT: the outcomment below is made to skip formatting days at all, so that
38
+ # following eitje business logic – we currently only return an hh:mm notation
39
+
40
+ # # parsing times into maxes (60 m, 24 h, ∞ days)
41
+ # th += tm / 60
42
+ # tm = tm % 60
43
+ # td += th / 24
44
+ # th = th % 24
45
+
46
+ # # formatting strings
47
+ # sd = td.to_s
48
+
45
49
  sh = th.to_s.rjust(2,'0')
46
50
  sm = tm.to_s.rjust(2,'0')
47
51
 
48
- [[sd, sh, sm].join(':')]
52
+ # ALERT: the outcomment below is made to skip formatting days at all, so that
53
+ # – following eitje business logic – we currently only return an hh:mm notation
54
+
55
+ # [[sd, sh, sm].join(':')]
56
+ [[sh, sm].join(':')]
49
57
  end
50
58
 
51
59
  def format_time(time)
@@ -35,6 +35,9 @@ module EitilWrapper
35
35
  def inherited(subclass)
36
36
  super
37
37
  subclass.use_eitil_scopes
38
+
39
+ rescue => e
40
+ puts "default scopes failed for #{subclass} because of #{e.class} and '#{e.to_s.split(' ').first}'"
38
41
  end
39
42
 
40
43
  def use_eitil_scopes
data/lib/eitil/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Eitil
2
2
 
3
- VERSION = '1.1.10'
3
+ VERSION = '1.1.14'
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.1.10
4
+ version: 1.1.14
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-07-07 00:00:00.000000000 Z
11
+ date: 2021-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails