jbuilder 2.15.0 → 2.15.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 92a9e6859ee3e4a852307625394f53c94bbf3022adee7534c8f9746abe2e5c28
4
- data.tar.gz: 9af5dfa8eb02f7a8c2dcbd9342ca5686fe33c2bcf171f34838599e64e23f9292
3
+ metadata.gz: c3f0a36b10c8ab54a2378daf5acb8f59126b9fe97dcebddac33bd2a4bd63b846
4
+ data.tar.gz: 0062fc739c0c288fb9f1864db1189b05bd0d0c6943481dc56bf00eb9a33f2662
5
5
  SHA512:
6
- metadata.gz: b03941877b974e49054bb41d50924520cf4a255daa73a107b32176b2db1c60cb6da117668195c5f6650be39e6405689c7f4958cc166ac1826d2bef4071a0b77a
7
- data.tar.gz: 0b668f703e2e082152a986b2574f78740c5d68e017683ede8be4bc5e6e1e432ef49e34ef2c4c9989b1a67181ef02fd3728688b34c88b60f829f4bb6f3cf0edc9
6
+ metadata.gz: 77d5b7b40bf5445c727b4e3fa4ddce979bd6d04c9a21336b1a486d6884d1f8cede1b0473944053ae5f1e2fc593cf1464e9e7c78b82fc230ef12381e25be53360
7
+ data.tar.gz: 4dd011c5f03e7e7f44cf456241078a218c420c9f80951480c2102a39fbcfb2ecc2ea2fd0a170025151e79c8db83517261c9cb53cd085b65faa8a7d6bbae3a922
@@ -52,7 +52,7 @@ class JbuilderTemplate < Jbuilder
52
52
  # json.comments @post.comments, partial: "comments/comment", as: :comment, cached: true
53
53
  #
54
54
  def partial!(*args)
55
- if _is_active_model?(args.first)
55
+ if args.one? && _is_active_model?(args.first)
56
56
  _render_active_model_partial args.first
57
57
  else
58
58
  options = args.extract_options!.dup
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Jbuilder < BasicObject
4
- VERSION = "2.15.0"
4
+ VERSION = "2.15.1"
5
5
  end
@@ -18,6 +18,7 @@ class JbuilderTemplateTest < ActiveSupport::TestCase
18
18
 
19
19
  RACER_PARTIAL = <<-JBUILDER
20
20
  json.extract! racer, :id, :name
21
+ json.highlighted local_assigns.fetch(:highlighted, false)
21
22
  JBUILDER
22
23
 
23
24
  PARTIALS = {
@@ -82,6 +83,13 @@ class JbuilderTemplateTest < ActiveSupport::TestCase
82
83
  assert_equal "Chris Harris", result["name"]
83
84
  end
84
85
 
86
+ test "partial for Active Model preserves extra locals" do
87
+ result = render('json.partial! @racer, highlighted: true', racer: Racer.new(123, "Chris Harris"))
88
+ assert_equal 123, result["id"]
89
+ assert_equal "Chris Harris", result["name"]
90
+ assert_equal true, result["highlighted"]
91
+ end
92
+
85
93
  test "partial collection by name with symbol local" do
86
94
  result = render('json.partial! "post", collection: @posts, as: :post', posts: POSTS)
87
95
  assert_equal 10, result.count
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jbuilder
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.15.0
4
+ version: 2.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
@@ -90,9 +90,9 @@ licenses:
90
90
  - MIT
91
91
  metadata:
92
92
  bug_tracker_uri: https://github.com/rails/jbuilder/issues
93
- changelog_uri: https://github.com/rails/jbuilder/releases/tag/v2.15.0
93
+ changelog_uri: https://github.com/rails/jbuilder/releases/tag/v2.15.1
94
94
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
95
- source_code_uri: https://github.com/rails/jbuilder/tree/v2.15.0
95
+ source_code_uri: https://github.com/rails/jbuilder/tree/v2.15.1
96
96
  rubygems_mfa_required: 'true'
97
97
  rdoc_options: []
98
98
  require_paths: