Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* [#3088](https://github.com/ruby-grape/grape/pull/3088): Pin workflow actions to commits and grant their tokens only what they need - [@ericproulx](https://github.com/ericproulx).
* [#3090](https://github.com/ruby-grape/grape/pull/3090): Call Danger's workflows from danger/danger-pr-comment, where they moved - [@ericproulx](https://github.com/ericproulx).
* [#3092](https://github.com/ruby-grape/grape/pull/3092): Skip posting empty Danger report comments - [@dblock](https://github.com/dblock).
* [#3095](https://github.com/ruby-grape/grape/pull/3095): Freeze Grape's constants all the way down - [@ericproulx](https://github.com/ericproulx).
* Your contribution here.

#### Fixes
Expand Down
2 changes: 1 addition & 1 deletion lib/grape/cookies.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Cookies
DELETED_COOKIES_ATTRS = {
max_age: '0',
value: '',
expires: Time.at(0)
expires: Time.at(0).freeze
}.freeze

def_delegators :cookies, :[], :each
Expand Down
2 changes: 1 addition & 1 deletion lib/grape/exceptions/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Exceptions
class Base < StandardError
include Grape::Util::Translation

MESSAGE_STEPS = %w[problem summary resolution].to_h { |s| [s.to_sym, s.capitalize] }.freeze
MESSAGE_STEPS = %w[problem summary resolution].to_h { |s| [s.to_sym, s.capitalize.freeze] }.freeze

attr_reader :status, :headers

Expand Down
2 changes: 1 addition & 1 deletion lib/grape/validations/params_scope.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def params(params)
# we maintain a list of them here and skip looking up validators for them.
RESERVED_DOCUMENTATION_KEYWORDS = %i[as required param_type is_array format example].freeze

SPECIAL_JSON = [JSON, Array[JSON]].freeze
SPECIAL_JSON = [JSON, [JSON].freeze].freeze

# What {#validated_params} returns for a scope that should not be
# validated. A plain +false+ would be indistinguishable from params of
Expand Down
4 changes: 2 additions & 2 deletions lib/grape/validations/types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ module Types

SPECIAL = {
::JSON => Json,
Array[JSON] => JsonArray,
[JSON].freeze => JsonArray,
::File => File,
Rack::Multipart::UploadedFile => File
}.freeze

GROUPS = [Array, Hash, JSON, Array[JSON]].freeze
GROUPS = [Array, Hash, JSON, [JSON].freeze].freeze

# Is the given class a primitive type as recognized by Grape?
#
Expand Down
Loading