spark-component 1.1.1 → 1.1.2

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: 76d73723f8423e6333f1ff46727f363096ad11cb3dc526c531ddbc8e8c30f0eb
4
- data.tar.gz: e302e38f303eb1d0c5ed8d8f591583b591dec48cf006d196194f014236a2899c
3
+ metadata.gz: 9464f05e5121dce8c628531abf34817e72c3cb83628a4c8b60f82d99292078d1
4
+ data.tar.gz: 6380a3ebc543c2d6a1e504d79f982b76a1e83205dd9af3bf8222caa683f7ee9d
5
5
  SHA512:
6
- metadata.gz: eec683787307ba6b95a59ee247ed138539375d96aab59b365785ddc23db4d98bde114df66d8a0b16df813861c7a6e6a75c8883a7573c60d5f0b7080996683c27
7
- data.tar.gz: af9031efb9b8ef31188bdd60d45025f359ccf201866b8a433c1ea1cfd299fb40ac0de40c15b019e747de55fcbec766ceff2ff66ca2846649f4f8a1e3d500a347
6
+ metadata.gz: f1bc76fb688cba102924ef87659a2615d1c8ce8eab2e9a482d4d6b15dfd582c2787f2969d68a5899d68b4524869d19d32350764412f0bd5bbc7747aed76b4d68
7
+ data.tar.gz: 2fbbecb520838250bfce8fac365d71f81e02464e093bcac19bc4b059b7cdae0c82dc20c4e1357bba66246bf64d0af6e56ed5e6daa12bbc43bbcad6993ec208d3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,7 @@
1
- # v1.1.1 - 2020-01-14
1
+ # v1.1.2 - 2020-01-14
2
+ - Fix: Added render checking to component to prevent executing `render_self` more than once.
2
3
 
4
+ # v1.1.1 - 2020-01-14
3
5
  - Fix: When a nested element is referenced it will trigger the parent to yield
4
6
  its block, ensuring that the nested element reference will be instantiated
5
7
  if it is used in the parent's block.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- spark-component (1.1.1)
4
+ spark-component (1.1.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -38,12 +38,13 @@ module Spark
38
38
  end
39
39
 
40
40
  def render_self
41
- return @content if rendered?
41
+ # Guard with `rendered?` boolean in case render_block returns `nil`
42
+ return @render_self if rendered?
42
43
 
43
- @content = render_block(@view_context, &_block)
44
+ @render_self = render_block(@view_context, &_block)
44
45
  validate! if defined?(ActiveModel::Validations)
45
46
  @rendered = true
46
- @content
47
+ @render_self
47
48
  end
48
49
 
49
50
  def rendered?
@@ -34,7 +34,11 @@ module Spark
34
34
  end
35
35
 
36
36
  def render_self
37
- render_in(@view_context, &@_block)
37
+ # Guard with `rendered?` boolean in case render_block returns `nil`
38
+ return @render_self if rendered?
39
+
40
+ @rendered = true
41
+ @render_self = render_in(@view_context, &@_block)
38
42
  end
39
43
 
40
44
  # Override class methods for components
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Spark
4
4
  module Component
5
- VERSION = "1.1.1"
5
+ VERSION = "1.1.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spark-component
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis