jbuilder 2.10.1 → 2.10.2

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: c33305909a9aa4be64b5dd83da1f6a5570654ab50a38042ae404da406f06cca3
4
- data.tar.gz: 5cc79921463b6cef4f7dbc37dba911e47a6a826824223a4b89a289f6ccf59dea
3
+ metadata.gz: 977b17be8a840c956c4043e24671792174502c57de951e215873b80b66b1031d
4
+ data.tar.gz: 847725cdbcfca6ba030942fa9d63b35b0fffd729587774c2dd020eaf75b0b786
5
5
  SHA512:
6
- metadata.gz: 5f2a7e1ed17babb16527afb6e12458ddadcbd5bb2129c110d4e426f573db610d2cc3f9d9d7d06c577c7608c97016c1ec5a60431237362c7d955d0674dcba2de3
7
- data.tar.gz: cf0820dc816f84fde3a2fa17010ce05e325bba7a830d4a0b7b26dafeafe17a73d2ce6734e7a0f3af54389f304439e58206897efa38bc97c63ba184b545f86ab3
6
+ metadata.gz: fcf001b86052df2bf45e8040630a6c3bcb9cb5ee5fee7910a636706fc7c05350a3a86feab542541f5b8290435fd8be61c8ca9cc17c1b1a3b87fb6626aeb9b495
7
+ data.tar.gz: 44d59c94049d3f76c9b3111408aabe16631deb5ef80fbde72a6e43a2a5807c2da3e47725dc8974384212cba178a48b76bb61cd114433593ccfd0dc3311e92b07
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ 2.10.2
4
+ ----------
5
+
6
+ * Update scaffold generator to use double quotes, 422 form error responds, and modern string-of-arrays syntax [DHH]
7
+
3
8
  2.10.1
4
9
  ----------
5
10
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'jbuilder'
3
- s.version = '2.10.1'
3
+ s.version = '2.10.2'
4
4
  s.authors = 'David Heinemeier Hansson'
5
5
  s.email = 'david@basecamp.com'
6
6
  s.summary = 'Create JSON structures via a Builder-style DSL'
@@ -4,7 +4,7 @@ require_dependency "<%= namespaced_path %>/application_controller"
4
4
  <% end -%>
5
5
  <% module_namespacing do -%>
6
6
  class <%= controller_class_name %>Controller < ApplicationController
7
- before_action :set_<%= singular_table_name %>, only: [:show, :update, :destroy]
7
+ before_action :set_<%= singular_table_name %>, only: %w[ show update destroy ]
8
8
 
9
9
  # GET <%= route_url %>
10
10
  # GET <%= route_url %>.json
@@ -4,7 +4,7 @@ require_dependency "<%= namespaced_path %>/application_controller"
4
4
  <% end -%>
5
5
  <% module_namespacing do -%>
6
6
  class <%= controller_class_name %>Controller < ApplicationController
7
- before_action :set_<%= singular_table_name %>, only: [:show, :edit, :update, :destroy]
7
+ before_action :set_<%= singular_table_name %>, only: %w[ show edit update destroy ]
8
8
 
9
9
  # GET <%= route_url %>
10
10
  # GET <%= route_url %>.json
@@ -33,10 +33,10 @@ class <%= controller_class_name %>Controller < ApplicationController
33
33
 
34
34
  respond_to do |format|
35
35
  if @<%= orm_instance.save %>
36
- format.html { redirect_to @<%= singular_table_name %>, notice: <%= "'#{human_name} was successfully created.'" %> }
36
+ format.html { redirect_to @<%= singular_table_name %>, notice: <%= %("#{human_name} was successfully created.") %> }
37
37
  format.json { render :show, status: :created, location: <%= "@#{singular_table_name}" %> }
38
38
  else
39
- format.html { render :new }
39
+ format.html { render :new, status: :unprocessable_entity }
40
40
  format.json { render json: <%= "@#{orm_instance.errors}" %>, status: :unprocessable_entity }
41
41
  end
42
42
  end
@@ -47,10 +47,10 @@ class <%= controller_class_name %>Controller < ApplicationController
47
47
  def update
48
48
  respond_to do |format|
49
49
  if @<%= orm_instance.update("#{singular_table_name}_params") %>
50
- format.html { redirect_to @<%= singular_table_name %>, notice: <%= "'#{human_name} was successfully updated.'" %> }
50
+ format.html { redirect_to @<%= singular_table_name %>, notice: <%= %("#{human_name} was successfully updated.") %> }
51
51
  format.json { render :show, status: :ok, location: <%= "@#{singular_table_name}" %> }
52
52
  else
53
- format.html { render :edit }
53
+ format.html { render :edit, status: :unprocessable_entity }
54
54
  format.json { render json: <%= "@#{orm_instance.errors}" %>, status: :unprocessable_entity }
55
55
  end
56
56
  end
@@ -61,7 +61,7 @@ class <%= controller_class_name %>Controller < ApplicationController
61
61
  def destroy
62
62
  @<%= orm_instance.destroy %>
63
63
  respond_to do |format|
64
- format.html { redirect_to <%= index_helper %>_url, notice: <%= "'#{human_name} was successfully destroyed.'" %> }
64
+ format.html { redirect_to <%= index_helper %>_url, notice: <%= %("#{human_name} was successfully destroyed.") %> }
65
65
  format.json { head :no_content }
66
66
  end
67
67
  end
@@ -31,22 +31,22 @@ class ScaffoldControllerGeneratorTest < Rails::Generators::TestCase
31
31
  assert_instance_method :create, content do |m|
32
32
  assert_match %r{@post = Post\.new\(post_params\)}, m
33
33
  assert_match %r{@post\.save}, m
34
- assert_match %r{format\.html \{ redirect_to @post, notice: 'Post was successfully created\.' \}}, m
34
+ assert_match %r{format\.html \{ redirect_to @post, notice: "Post was successfully created\." \}}, m
35
35
  assert_match %r{format\.json \{ render :show, status: :created, location: @post \}}, m
36
- assert_match %r{format\.html \{ render :new \}}, m
36
+ assert_match %r{format\.html \{ render :new, status: :unprocessable_entity \}}, m
37
37
  assert_match %r{format\.json \{ render json: @post\.errors, status: :unprocessable_entity \}}, m
38
38
  end
39
39
 
40
40
  assert_instance_method :update, content do |m|
41
- assert_match %r{format\.html \{ redirect_to @post, notice: 'Post was successfully updated\.' \}}, m
41
+ assert_match %r{format\.html \{ redirect_to @post, notice: "Post was successfully updated\." \}}, m
42
42
  assert_match %r{format\.json \{ render :show, status: :ok, location: @post \}}, m
43
- assert_match %r{format\.html \{ render :edit \}}, m
43
+ assert_match %r{format\.html \{ render :edit, status: :unprocessable_entity \}}, m
44
44
  assert_match %r{format\.json \{ render json: @post.errors, status: :unprocessable_entity \}}, m
45
45
  end
46
46
 
47
47
  assert_instance_method :destroy, content do |m|
48
48
  assert_match %r{@post\.destroy}, m
49
- assert_match %r{format\.html \{ redirect_to posts_url, notice: 'Post was successfully destroyed\.' \}}, m
49
+ assert_match %r{format\.html \{ redirect_to posts_url, notice: "Post was successfully destroyed\." \}}, m
50
50
  assert_match %r{format\.json \{ head :no_content \}}, m
51
51
  end
52
52
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jbuilder
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.10.1
4
+ version: 2.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-12 00:00:00.000000000 Z
11
+ date: 2021-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -24,7 +24,7 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 5.0.0
27
- description:
27
+ description:
28
28
  email: david@basecamp.com
29
29
  executables: []
30
30
  extensions: []
@@ -71,7 +71,7 @@ homepage: https://github.com/rails/jbuilder
71
71
  licenses:
72
72
  - MIT
73
73
  metadata: {}
74
- post_install_message:
74
+ post_install_message:
75
75
  rdoc_options: []
76
76
  require_paths:
77
77
  - lib
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  version: '0'
88
88
  requirements: []
89
89
  rubygems_version: 3.1.2
90
- signing_key:
90
+ signing_key:
91
91
  specification_version: 4
92
92
  summary: Create JSON structures via a Builder-style DSL
93
93
  test_files: