eitil 1.1.11 → 1.1.12

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: fb5b8d9dedd62dc33e0a699d7ac97a081c3358e8d878ebf20ef57d5c11d390a8
4
- data.tar.gz: ffaf812ed80877209f13c121682c9deeaf92af766dd59ebd1cc7c9efba98034b
3
+ metadata.gz: 707b27f67c74dec844efce22b99755420d624a11060e5c7fafdd0a4b3b4ce60a
4
+ data.tar.gz: 47c775e85c7f8d04466c802b8b717a8c6c478c982b0d34935e21f1846bff7d11
5
5
  SHA512:
6
- metadata.gz: e6c0579e8e4a8d29ea9b1f1bf17a9a6a941100aa9e43115116de1e657ca0d1c02bc2458a2815ff0526b8adfa0847c5a570e5f933bb0d3a50de7f60af891ca987
7
- data.tar.gz: 0b6959185dc1d36b8c68d0defc7f13ec6ef31875a24daef3d7bcd9bc78afa3d95627d6f0db95109ea93ad247d34e9ddf2db2b7741fa4e266bd953c0e4fefc8da
6
+ metadata.gz: 06023f05445799146cf9a4e43e4a9247f89281ee59a5770b909541641024052ef8c34ae9ab07dfd03191f0c43484ed84f2c5d2c321b89bf4958261f73f086171
7
+ data.tar.gz: 52aa15d5003c3234703426e365d1488442cd8e4230c7423489cd4713c2ef3bc2aea662ca984ef104cece728e2c6397d7ce29a828c50fd4734b7fba3ce9f552c6
@@ -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"
@@ -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)
@@ -25,7 +25,7 @@ module EitilIntegrate::RubyXL
25
25
  report_state
26
26
 
27
27
  # style logs
28
- style_first_x_columns_width(1, 40)
28
+ base_style_first_x_columns_width 1, 40
29
29
  style_first_column_bold
30
30
 
31
31
  # restore what was previously active
@@ -59,6 +59,8 @@ module EitilIntegrate::RubyXL
59
59
  base_style_x_columns_width (0...n_columns), width
60
60
  end
61
61
 
62
+ alias_method :base_style_first_x_columns_width, :style_first_x_columns_width
63
+
62
64
  def style_x_columns_width(column_indices = [], width)
63
65
  column_indices.each { |i| @sheet.change_column_width(i, width) }
64
66
  end
data/lib/eitil/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Eitil
2
2
 
3
- VERSION = '1.1.11'
3
+ VERSION = '1.1.12'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eitil
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.11
4
+ version: 1.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jurriaan Schrofer