Skip to content

Commit

Permalink
Generate symbols, not strings, for the filtering of before_action
Browse files Browse the repository at this point in the history
  • Loading branch information
dhh committed Jan 24, 2021
1 parent 153656d commit c033501
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/generators/rails/templates/api_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<% end -%>
<% module_namespacing do -%>
class <%= controller_class_name %>Controller < ApplicationController
before_action :set_<%= singular_table_name %>, only: %w[ show update destroy ]
before_action :set_<%= singular_table_name %>, only: %i[ show update destroy ]
# GET <%= route_url %>
# GET <%= route_url %>.json
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/rails/templates/controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<% end -%>
<% module_namespacing do -%>
class <%= controller_class_name %>Controller < ApplicationController
before_action :set_<%= singular_table_name %>, only: %w[ show edit update destroy ]
before_action :set_<%= singular_table_name %>, only: %i[ show edit update destroy ]
# GET <%= route_url %>
# GET <%= route_url %>.json
Expand Down

0 comments on commit c033501

Please sign in to comment.