effective_resources 0.4.3 → 0.4.4

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
  SHA1:
3
- metadata.gz: 1ea8856025d95c68494d488970226e6c212a919d
4
- data.tar.gz: b024cdc31307bf491b9432d7bb24e84928edb16a
3
+ metadata.gz: 10c047350e78353e5509d24980209bc53916e39c
4
+ data.tar.gz: fd7eab9a51c6c9c2d2a634431a6ab9696079708d
5
5
  SHA512:
6
- metadata.gz: 80b4b4aec2b1bc80403e808e72949904c4a8d791e7c42f2f848aa4056424ea937514d3896565a1c82e53a747564f2fb0b7788ac5378e07590abf899e952218ef
7
- data.tar.gz: 60b75dbf6e5c7cedd1448e6599090b9be54106bb6cbd1603a48fb90ada7cc8034999d1613c710e0fcc721ee67cb428032b9cd22350a28530e3299849482ce9cd
6
+ metadata.gz: ca9824a092e57a9c8e87546bf09fc21d9e20134038a9103d3c900ea87119606e88e63dc532a187b5de049f063be613b9cf9361f40ccfdb4fba3ac4d44db4c82e
7
+ data.tar.gz: 670074c014a952d6949c2e768845fdf54b7544910a10440c325bf7bda239d62cf078b70783b1d783b724ce2e90310a2ec24ff49d2103bad76a165e785c5172f6
@@ -17,6 +17,7 @@ module Effective
17
17
  when ActiveRecord::Reflection::MacroReflection
18
18
  ((input.klass rescue nil).presence || _klass_by_name(input.class_name)) unless input.options[:polymorphic]
19
19
  when ActionDispatch::Journey::Route
20
+ @initialized_name = input.defaults[:controller]
20
21
  _klass_by_name(input.defaults[:controller])
21
22
  when Class
22
23
  input
@@ -21,7 +21,9 @@ module Effective
21
21
  @controller_klass ||= (
22
22
  "#{namespaced_class_name.pluralize}Controller".safe_constantize ||
23
23
  "#{class_name.pluralize.classify}Controller".safe_constantize ||
24
- "#{name.pluralize.classify}Controller".safe_constantize
24
+ "#{name.pluralize.classify}Controller".safe_constantize ||
25
+ "#{initialized_name.to_s.classify.pluralize}Controller".safe_constantize ||
26
+ "#{initialized_name.to_s.classify}Controller".safe_constantize
25
27
  )
26
28
  end
27
29
 
@@ -11,6 +11,10 @@ module Effective
11
11
  name.pluralize
12
12
  end
13
13
 
14
+ def initialized_name
15
+ @initialized_name
16
+ end
17
+
14
18
  def class_name # 'Effective::Post'
15
19
  @model_klass.try(:name).to_s
16
20
  end
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '0.4.3'.freeze
2
+ VERSION = '0.4.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-14 00:00:00.000000000 Z
11
+ date: 2017-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails