eitil 1.3.2 → 1.3.3

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: c476bec69197002e34513b633e1cdadbb8498c8c3dc25cf50bbde796ea6e2991
4
- data.tar.gz: 43703b8c42157e5ab27933eb4779c3e6d9b5a34896d528d337678669730d3d09
3
+ metadata.gz: 9e09221af058e64779e66dc191c93be16a85592f7abc9fb3baca2c758732f04d
4
+ data.tar.gz: bc3548f2643a9880cda0a9b78c82581afae5413ff09bfe6cd6b01ec6d34a2b43
5
5
  SHA512:
6
- metadata.gz: 61bb9bbb7d03844ec0b7dd6061e1000665cc6a7997ed0312bbe6e65ad7b71adc696bd86534b8002f36a061fb6d0ef1567fafb8e508a4001463784aa4f442a763
7
- data.tar.gz: d315eec8ad4a9deeced007e60c63e7f31239b7993e4d2e7eeb4cf2289a40b5d1fb01bdf26695e2b8c80373a336493facb6ef0656e33e62fddfdcfa9b7600d93a
6
+ metadata.gz: df035ec77f87a82d84c55a98e4862a83a7f3696c70e9bdafc61df7c93c1c2c0ff002b554e0ae05b2f623bc100dfda09bd17d099293e13c70f54b59e327f2e1f1
7
+ data.tar.gz: 53995982137b13b5d2c23701748b79d443de3807f150e677af544b1b36301c5e530aafe9f13ec0e3c0dcb43d3d43145fa78f0248e526a5532e46a35db97a8a53
@@ -14,8 +14,15 @@ module EitilWrapper
14
14
 
15
15
  def inherited(subclass)
16
16
  super
17
-
18
17
  return if Eitil.skip_callback_helper_methods_for_models.include?(subclass.to_s.to_sym)
18
+
19
+ # Set the proper table_names for namespaced models. Without setting this,
20
+ # Rails run into problems due to the fact that the first call to the model's
21
+ # constant triggers this initializer first, and only thereafter the model file
22
+ # which sets the correct table_name through a macro.
23
+ namespaced_class = subclass.to_s.include?('::')
24
+ subclass.table_name = subclass.to_s.gsub('::', '_').downcase.pluralize if namespaced_class
25
+
19
26
  subclass.use_eitil_callback_helper_methods
20
27
 
21
28
  rescue => e
@@ -36,8 +36,15 @@ module EitilWrapper
36
36
 
37
37
  def inherited(subclass)
38
38
  super
39
-
40
39
  return if Eitil.skip_default_scopes_for_models.include?(subclass.to_s.to_sym)
40
+
41
+ # Set the proper table_names for namespaced models. Without setting this,
42
+ # Rails run into problems due to the fact that the first call to the model's
43
+ # constant triggers this initializer first, and only thereafter the model file
44
+ # which sets the correct table_name through a macro.
45
+ namespaced_class = subclass.to_s.include?('::')
46
+ subclass.table_name = subclass.to_s.gsub('::', '_').downcase.pluralize if namespaced_class
47
+
41
48
  subclass.use_eitil_scopes
42
49
 
43
50
  rescue => e
data/lib/eitil/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Eitil
2
2
 
3
- VERSION = '1.3.2'
3
+ VERSION = '1.3.3'
4
4
 
5
5
  end
Binary file
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.2
4
+ version: 1.3.3
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-14 00:00:00.000000000 Z
11
+ date: 2021-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails