jb 0.2.0 → 0.3.0

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: 7cc429668499e99d5acd8fc816c5edbecd363d57
4
- data.tar.gz: debb9265b363fa660ef632fa1fde79c76f0a1065
3
+ metadata.gz: 04fdf2c5bbc180bc3741903401967e5ddae04a75
4
+ data.tar.gz: 4c05db1fb1ff97a1a4030d8446495c833746699d
5
5
  SHA512:
6
- metadata.gz: 0f24ea0311ab49e1bdc5559f04e9feabc829643c4a9f1bdf9714084bb903589d81ea266ef8c269adb06c10ba27b9b7b255eae9a1e3366116e475f8f9ac212d9f
7
- data.tar.gz: 30a0eb11d629dae406df1407de317cad6aad8bd59119cbd926f1041342483f3dad4a5a3735c8cf8433c2693aa506c37955f874cbf486910fba51a587fce271c7
6
+ metadata.gz: e046dd884938c4438a604e685376f498c963fa5a546a87440be4344593f42a8e2344a84a68dc22af4b7d64b5ae0e71d2c25568493cd518e422eeb450e4342ece
7
+ data.tar.gz: d4b1b3a2e9c18129b9a91a333b5cb328946eecabb995a98373f8c84937b125450d5034c7ce6a8169695307905343217e301ff0e1fb1a7d5634988d41310e2a7c
data/README.md CHANGED
@@ -225,7 +225,7 @@ So, for example if the collection has 100 elements, Jbuilder's `render partial:`
225
225
  OTOH, Jb simply calls [ActionView::PartialRenderer's `render`](https://github.com/rails/rails/blob/49a881e0db1ef64fcbae2b7ddccfd5ccea26ae01/actionview/lib/action_view/renderer/partial_renderer.rb#L423-L443) which is cleverly implmented to `find_template` only once beforehand, then pass each element to that template.
226
226
 
227
227
 
228
- ## Bencharks
228
+ ## Benchmarks
229
229
  Here're the results of a benchmark (which you can find [here](https://github.com/amatsuda/jb/blob/master/test/dummy_app/app/controllers/benchmarks_controller.rb) in this repo) rendering a collection to JSON.
230
230
 
231
231
  ### RAILS_ENV=development
@@ -29,6 +29,11 @@ module Jb
29
29
  private def collection_without_template
30
30
  super.extend StrongArray
31
31
  end
32
+
33
+ private def render_collection
34
+ return [] if @collection.blank?
35
+ super
36
+ end
32
37
  end
33
38
  end
34
39
 
@@ -1,3 +1,3 @@
1
1
  module Jb
2
- VERSION = '0.2.0'
2
+ VERSION = '0.3.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akira Matsuda
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-07-07 00:00:00.000000000 Z
11
+ date: 2016-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -126,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
126
  version: '0'
127
127
  requirements: []
128
128
  rubyforge_project:
129
- rubygems_version: 2.6.4
129
+ rubygems_version: 2.5.1
130
130
  signing_key:
131
131
  specification_version: 4
132
132
  summary: Faster and simpler Jbuilder alternative