view_component 2.22.0 → 2.22.1

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.

Potentially problematic release.


This version of view_component might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a9c3a94a5583fa593efd0d7f90b0bcbf48fb0436c05233594b6ff41dba6a52cc
4
- data.tar.gz: f859ddf3a59cc181215ea3b7b7e848f08cd8d791b59896512633ba2533f53b5a
3
+ metadata.gz: 443af024d4cbb4251192a8d21eb95d40ad011aaac81a6572acfade86fd237f2d
4
+ data.tar.gz: bf7768afd857d6ed5580105a947fb5329615b01513f748c7856e33cd1cc43af9
5
5
  SHA512:
6
- metadata.gz: 70d5b2e41eaa8b192246a85d91ca0a269f0050b296050edb93eda910e7df3249a2784f6518f35285862786b1ef51f749677f502897261c098f4d5e29365f3f38
7
- data.tar.gz: 1012abb02ab64ab80afbe8143abe262a16bdef606b50af4beecc34c554ff7ee327228512a9f5ed85e625e72511fa26b3b48ce5aaabec7d5a183453e33191cc7d
6
+ metadata.gz: 3f04ddd1e8c82e8b7bf586eb249a0c8dcbdf6a3b214c9b26fabf988d2c1696f78cd684654d8a7ffc7d86bf8e282204a8643784bc1c8b0153338b688b8cfe252f
7
+ data.tar.gz: 4b7d2fa52955349650500493c90882b05809b74fb447d590ea96aea9781198233dd091db7db1b4a643c4185830f9ff10b8e5a44dd2c48ccb3c9f8c42ad0525ea
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 2.22.1
6
+
7
+ * Revert refactor that broke rendering for some users.
8
+
9
+ *Joel Hawksley*
10
+
5
11
  ## 2.22.0
6
12
 
7
13
  * Add #with_variant to enable inline component variant rendering without template files.
@@ -102,7 +102,11 @@ module ViewComponent
102
102
  # If trying to render a partial or template inside a component,
103
103
  # pass the render call to the parent view_context.
104
104
  def render(options = {}, args = {}, &block)
105
- view_context.render(options, args, &block)
105
+ if options.is_a?(String) || (options.is_a?(Hash) && options.has_key?(:partial))
106
+ view_context.render(options, args, &block)
107
+ else
108
+ super
109
+ end
106
110
  end
107
111
 
108
112
  def controller
@@ -113,7 +117,7 @@ module ViewComponent
113
117
  # Provides a proxy to access helper methods from the context of the current controller
114
118
  def helpers
115
119
  raise ViewContextCalledBeforeRenderError, "`helpers` can only be called at render time." if view_context.nil?
116
- @helpers ||= view_context
120
+ @helpers ||= controller.view_context
117
121
  end
118
122
 
119
123
  # Exposes .virutal_path as an instance method
@@ -4,7 +4,7 @@ module ViewComponent
4
4
  module VERSION
5
5
  MAJOR = 2
6
6
  MINOR = 22
7
- PATCH = 0
7
+ PATCH = 1
8
8
 
9
9
  STRING = [MAJOR, MINOR, PATCH].join(".")
10
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: view_component
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.22.0
4
+ version: 2.22.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub Open Source
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-09 00:00:00.000000000 Z
11
+ date: 2020-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport