eac_rails_utils 0.9.1 → 0.10.0

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: '070818893e602b09a2538f7fecdf3e159b04f8931aedb85910c946efa5fd0cfc'
4
- data.tar.gz: 4f46a31ee815870ccf57ec9af054e535dec59401e663eeb1fc611bbf12301dd5
3
+ metadata.gz: ab860f53094962e32a5e54686f4cb83382c0a60509837057e68f64c649c3d97b
4
+ data.tar.gz: e14470c3dca4c307484ea19896c3b6742ab797a0fdf97b80737624fc03209b57
5
5
  SHA512:
6
- metadata.gz: a7c56168765423a3dbc7fd9cb5a72d98e2ae60263e1f9b93a7ac4295045c4eadcb0d5f14aec7e17c86744b2196d52b0ccd5b3e5c530d986a7574576765cbeeef
7
- data.tar.gz: 7a7c5c499393c8b8d49f0e7de68df86d7a0434b5e1902572faa22a093f8178631483eec53fff74a8f0d548f40310d1303ad3c7ae5c20f2561a5af5160be443d2
6
+ metadata.gz: 11a1e93764e5dc3d5fa6a362ad518bbbcc451962e6240038d840e2c46ae71dc63b5a14fa3af6b9cac56295e0b92d07c0bb34dd2c22d02df9961f2052e36f2bde
7
+ data.tar.gz: c846e7c3205d37f615bbcd2f321cd99ef1e4e6ee4e90e6aa68c809eb97b2610f1543e2ba55d4b455067d180a6c9ba58bcfd74b606229ca3720c8f2bb0ab0c778
@@ -35,7 +35,7 @@ module EacRailsUtils
35
35
  end
36
36
 
37
37
  def object_path(object, action = nil)
38
- current_class = object.class
38
+ current_class = object_class(object)
39
39
  tried_paths = []
40
40
  while current_class
41
41
  path = object_path_by_class(current_class, action)
@@ -68,5 +68,12 @@ module EacRailsUtils
68
68
  path = "#{action}_#{path}" if action.present?
69
69
  path
70
70
  end
71
+
72
+ def object_class(object)
73
+ return object.entity_class if object.respond_to?(:entity_class)
74
+ return object.__getobj__.class if object.respond_to?(:__getobj__)
75
+
76
+ object.class
77
+ end
71
78
  end
72
79
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRailsUtils
4
- VERSION = '0.9.1'
4
+ VERSION = '0.10.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_rails_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - E.A.C.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-22 00:00:00.000000000 Z
11
+ date: 2020-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel-associations