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

fix type fully qualified [ci skip] #30533

Merged
merged 1 commit into from
Sep 6, 2017
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion actionpack/test/controller/rescue_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ResourceUnavailable < StandardError
class ResourceUnavailableToRescueAsString < StandardError
end

# We use a fully-qualified name in some strings, and a relative constant
# We use a fully qualified name in some strings, and a relative constant
# name in some other to test correct handling of both cases.

rescue_from NotAuthorized, with: :deny_access
Expand Down
6 changes: 3 additions & 3 deletions guides/source/active_support_core_extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ NOTE: Defined in `active_support/core_ext/module/introspection.rb`.

#### `parent_name`

The `parent_name` method on a nested named module returns the fully-qualified name of the module that contains its corresponding constant:
The `parent_name` method on a nested named module returns the fully qualified name of the module that contains its corresponding constant:

```ruby
module X
Expand Down Expand Up @@ -3708,9 +3708,9 @@ Extensions to `NameError`

Active Support adds `missing_name?` to `NameError`, which tests whether the exception was raised because of the name passed as argument.

The name may be given as a symbol or string. A symbol is tested against the bare constant name, a string is against the fully-qualified constant name.
The name may be given as a symbol or string. A symbol is tested against the bare constant name, a string is against the fully qualified constant name.

TIP: A symbol can represent a fully-qualified constant name as in `:"ActiveRecord::Base"`, so the behavior for symbols is defined for convenience, not because it has to be that way technically.
TIP: A symbol can represent a fully qualified constant name as in `:"ActiveRecord::Base"`, so the behavior for symbols is defined for convenience, not because it has to be that way technically.

For example, when an action of `ArticlesController` is called Rails tries optimistically to use `ArticlesHelper`. It is OK that the helper module does not exist, so if an exception for that constant name is raised it should be silenced. But it could be the case that `articles_helper.rb` raises a `NameError` due to an actual unknown constant. That should be reraised. The method `missing_name?` provides a way to distinguish both cases:

Expand Down