eitil 1.1.35 → 1.1.39

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: b74b9f015784dffbc676bc9267714da2a00fe4bb2a8850cffdea897b562d1c76
4
- data.tar.gz: 77d4c34da79041eccf1964b06af3f6a172b6d90f3e47447583f6ca32f1760c6a
3
+ metadata.gz: f8baf9893cc66d802a9cfa257b9f7e9d9773454837b397684e2b30c188400d2b
4
+ data.tar.gz: c0f9b000df38b13078bfdc5b348f5e6e5f4732bfabfa96c0d972bd764134e069
5
5
  SHA512:
6
- metadata.gz: ff1d56dd9b839a9e0b7fcb4d6ec3bcd3c982f7d05cf3b9d555c71752b0efbd3414d77e9b14e61e8a589a1f23bda83a8d73dc7e995f6371da68e6d46dc79a8462
7
- data.tar.gz: 2be6215bd658c92994007989012d0278136950c506d4ab325a1a8ac1849e5a68d5d17a8d68347d480186053d30d0741d55f49b9e44c193a75edd1f7ba2cc4626
6
+ metadata.gz: 3207e89a489f0f5fca78f2647ef1624b476e2b410a0c7fd5a8b67aa13f4db8bc9f7985a54622af6039bd92ba3b713195d8f218af7fe6d8a35dc48dc5844e5e88
7
+ data.tar.gz: 68368b42bd8a8cf2b9b93c19d070dbefa378d73377012959d189d57a45c03c99b85f608bbfd0dc680cee9fee8e7ed090a8b51301500b666651da8e3851fa9d4f
@@ -31,9 +31,13 @@ module EitilIntegrate::RubyXL
31
31
 
32
32
  # returns the exporter_infos, without the datatypes – for taxonomy purpuses, the field
33
33
  # names are often sufficient
34
- def exporter_taxonomy
35
- exporter_infos.transform_values do |settings|
36
- settings.transform_values { |info| info.first.is_a?(Hash) ? info.first.keys : info }
34
+ def exporter_taxonomy
35
+ parameter_fields = exporter_infos.transform_values { |v| v.select { |k,v| k == :required || k == :optional } }
36
+
37
+ parameter_fields.transform_values do |setting_collection|
38
+ setting_collection.transform_values do |setting|
39
+ setting.map { |key| key.is_a?(Hash) ? key.keys : key }.flatten
40
+ end
37
41
  end
38
42
  end
39
43
 
@@ -10,7 +10,10 @@ module EitilSupport::Stack::Audit
10
10
  # .report_app_calls filters the stack on calls whose path include "/app/", since
11
11
  # audits otherwise tend to grow very big, which might endanger the database.
12
12
  stacktrace = EitilSupport::Stack.new.report_app_calls
13
- self.audits.last.update(stacktrace: stacktrace)
13
+
14
+ # Safe operator in order to avoid raising a NoMetodError when the record
15
+ # has no audits yet.
16
+ self.audits.last&.update(stacktrace: stacktrace)
14
17
  end
15
18
 
16
19
  end
@@ -14,6 +14,8 @@ module EitilWrapper
14
14
 
15
15
  def inherited(subclass)
16
16
  super
17
+
18
+ return if Eitil.skip_callback_helper_methods_for_models.include?(subclass.to_s.to_sym)
17
19
  subclass.use_eitil_callback_helper_methods
18
20
 
19
21
  rescue => e
@@ -36,6 +36,8 @@ module EitilWrapper
36
36
 
37
37
  def inherited(subclass)
38
38
  super
39
+
40
+ return if Eitil.skip_default_scopes_for_models.include?(subclass.to_s.to_sym)
39
41
  subclass.use_eitil_scopes
40
42
 
41
43
  rescue => e
data/lib/eitil/railtie.rb CHANGED
@@ -1,4 +1,6 @@
1
1
 
2
+
3
+
2
4
  # Constants
3
5
 
4
6
  module Eitil
@@ -9,8 +11,53 @@ module Eitil
9
11
 
10
12
  end
11
13
 
14
+
15
+
12
16
  # Configuration
13
17
 
18
+ module Eitil
19
+ class Railtie < ::Rails::Railtie
20
+
21
+ # The following configuration has its own special place in the boot sequence:
22
+ # on the one hand, it should run before the initialization of Eitil (gem), but
23
+ # read config assigned by the main app – which is only loaded AFTER all gems have
24
+ # been initialized.
25
+
26
+ # Therefore, we only require the specified file from the main app, after defining
27
+ # the possible configurations for the Eitil railtie. This way we escape the boot
28
+ # sequence's dedault order.
29
+
30
+ config.before_initialize do |eitil|
31
+
32
+ Eitil.mattr_accessor :controller_ivars,
33
+ :skip_default_scopes_for_models,
34
+ :skip_callback_helper_methods_for_models
35
+
36
+ Eitil.controller_ivars ||= []
37
+ Eitil.skip_default_scopes_for_models ||= []
38
+ Eitil.skip_callback_helper_methods_for_models ||= []
39
+
40
+ def Eitil.set_config(&block)
41
+ yield Eitil
42
+ end
43
+
44
+ config_path = Rails.root + 'config/initializers/eitil.rb'
45
+
46
+ if File.exists? config_path
47
+ puts "Loading Eitil config from #{config_path}..."
48
+ load config_path
49
+ else
50
+ puts "Eitil config not found at #{config_path}, resorting to defaults..."
51
+ end
52
+
53
+ end
54
+ end
55
+ end
56
+
57
+
58
+
59
+ # Loading
60
+
14
61
  module Eitil
15
62
 
16
63
  class Railtie < ::Rails::Railtie
@@ -27,12 +74,4 @@ module Eitil
27
74
 
28
75
  end
29
76
 
30
- mattr_accessor :controller_ivars
31
-
32
- self.controller_ivars ||= []
33
-
34
- def self.set_config(&block)
35
- yield self
36
- end
37
-
38
77
  end
data/lib/eitil/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Eitil
2
2
 
3
- VERSION = '1.1.35'
3
+ VERSION = '1.1.39'
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.35
4
+ version: 1.1.39
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-09-02 00:00:00.000000000 Z
11
+ date: 2021-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails