Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Symbol value for :block in #allow_browser #689

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 4 additions & 0 deletions gems/actionpack/7.2/_test/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ class FooController < ActionController::Base
class BarController < ActionController::Base
allow_browser versions: { safari: 17.5, chrome: 127, ie: false }, block: -> { head :not_acceptable }
end

class CanalController < ActionController::Base
allow_browser versions: { safari: 17.5, chrome: 127, ie: false }, block: :handle_outdated_browser
end
3 changes: 3 additions & 0 deletions gems/actionpack/7.2/_test/test.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ end

class BarController < ActionController::Base
end

class CanalController < ActionController::Base
end
2 changes: 1 addition & 1 deletion gems/actionpack/7.2/actioncontroller-7.2.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module ActionController
extend ActiveSupport::Concern

module ClassMethods
def allow_browser: (versions: :modern | Hash[untyped, false | _ToS], ?block: ^() [self: Base] -> void, **untyped options) -> void
def allow_browser: (versions: :modern | Hash[untyped, false | _ToS], ?block: (^() [self: Base] -> void | Symbol), **untyped options) -> void
end
end

Expand Down