jbuilder 2.2.3 → 2.2.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: 2d59129031b5d4863366f26212729fe78079237e
4
- data.tar.gz: 9d77187b141e1f62c7393c3c721ad4fc54759026
3
+ metadata.gz: be81ed49885fba62e1be99f82e778dd69d889884
4
+ data.tar.gz: e3ce3c36b31fac82c99aa62bc274f548be51ce59
5
5
  SHA512:
6
- metadata.gz: 0bab7d7b62fcd543458780a892a94752a5fe1f2f34d163cefd9a0b69cea277ce00b602b2854ad5f6175b164e42400c68bf746000b5a39928c3aae63ea25ab306
7
- data.tar.gz: ea31d042bb585dbbfdaac96feb13ee78cc7b66d169bef2802e9d2dbad168f8021c38bcf4a02d5793b36ad6ebc1dff6e6668da5a84a61c6e33e0ab848408fd647
6
+ metadata.gz: 2995890c44f8b03169574e2e6d7bf1a46c982d12318048967f97ed959b7b5222b5f557af402129a0fbb9ad4123f0a6d3839415a947ba59c7d5ffd72a32b2b40a
7
+ data.tar.gz: b5167713398b4588bfe1183342d84b621108fa8141c685d7fac7d92f97eba4482dc9f88b58c0518126a38f36a20bdcb5a166254b9cdb5d6deff81ca3674f517d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ 2.2.4
4
+ -----
5
+ * [Typecast locals hash key during collection render](https://github.com/rails/jbuilder/commit/a6b0c8651a08e01cb53eee38e211c65423f275f7)
6
+
3
7
  2.2.3
4
8
  -----
5
9
  * [Move template handler registration into railtie](https://github.com/rails/jbuilder/commit/c8acc5cea6da2a79b7b345adc301cb5ff2517647)
data/jbuilder.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'jbuilder'
3
- s.version = '2.2.3'
3
+ s.version = '2.2.4'
4
4
  s.authors = ['David Heinemeier Hansson', 'Pavel Pravosud']
5
5
  s.email = ['david@37signals.com', 'pavel@pravosud.com']
6
6
  s.summary = 'Create JSON structures via a Builder-style DSL'
@@ -81,6 +81,7 @@ class JbuilderTemplate < Jbuilder
81
81
  as = options[:as]
82
82
 
83
83
  if as && options.key?(:collection)
84
+ as = as.to_sym
84
85
  collection = options.delete(:collection)
85
86
  locals = options.delete(:locals)
86
87
  array! collection do |member|
@@ -118,10 +118,20 @@ class JbuilderTemplateTest < ActionView::TestCase
118
118
  assert_collection_rendered json
119
119
  end
120
120
 
121
+ test 'partial! renders collections when as argument is a string' do
122
+ json = render_jbuilder <<-JBUILDER
123
+ json.partial! 'blog_post', collection: BLOG_POST_COLLECTION, as: "blog_post"
124
+ JBUILDER
125
+
126
+ assert_collection_rendered json
127
+ end
128
+
121
129
  test 'partial! renders collections as collections' do
122
130
  json = render_jbuilder <<-JBUILDER
123
131
  json.partial! 'collection', collection: COLLECTION_COLLECTION, as: :collection
124
132
  JBUILDER
133
+
134
+ assert_equal 5, MultiJson.load(json).length
125
135
  end
126
136
 
127
137
  test 'partial! renders as empty array for nil-collection' do
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.2.3
4
+ version: 2.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-10-18 00:00:00.000000000 Z
12
+ date: 2014-10-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport