| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
[ci skip]
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch uniformizes warning messages. I used the most common style
already present in the code base:
* Capitalize the first word.
* End the message with a full stop.
* "Rails 5" instead of "Rails 5.0".
* Backticks for method names and inline code.
Also, converted a few long strings into the new heredoc convention.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current style for warning messages without newlines uses
concatenation of string literals with manual trailing spaces
where needed.
Heredocs have better readability, and with `squish` we can still
produce a single line.
This is a similar use case to the one that motivated defining
`strip_heredoc`, heredocs are super clean.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
In cases where this option is set to `true`, the option is redundant and can
be safely removed; otherwise, the corresponding `*_url` helper should be
used instead.
Fixes #17294.
See also #17363.
[Dan Olson, Godfrey Chan]
|
| |
|
|
|
|
|
|
|
|
| |
This reverts commit 9d05d6de52871e57bfbf54a60de005e8a5f5b0e4, reversing
changes made to 0863c9248fd47a15e88e05ce4fcd80966684c0e3.
The change in the behaviour reported at #16958 doesn't exist since 4.0
and 4.1 works in the same way
|
| |
|
| |
|
|
|
|
| |
Fixes #17057
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Suppose you have two resources routed in the following manner:
```ruby
resources :blogs do
resources :posts
end
resources :posts
```
When using polymorphic resource routing like `url_for([@blog, @post])`, and `@blog` is `nil` Rails should still try to match the route to the top-level posts resource.
Fixes #16754
|
|
|
|
|
|
|
|
| |
https://github.com/rails/rails/commit/402c2af55053c2f29319091ad21fd6fa6b90ee89
introduced a regression that caused any constraints added to redirect routes
to be ignored.
Fixes #16605
|
|\
| |
| |
| | |
Use #model_name on instances instead of classes
|
| |
| |
| |
| |
| |
| | |
This allows rails code to be more confdent when asking for a model name, instead of having to ask for the class.
Rails core discussion here: https://groups.google.com/forum/#!topic/rubyonrails-core/ThSaXw9y1F8
|
| |
| |
| |
| |
| |
| | |
This method was removed at 210b338db20b1cdd0684f40bd78b52ed16148b99 but it is
used by third party gems to check if a named route was defined. To help on the
upgrade path on 4.2.0 we bring it back and emit a deprecation warning.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
this will help us to encapsulate magical symbols so hopefully we can
eliminate hardcoded magic symbols
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
now we don't have to have a hard coded key
|
| |
| |
| |
| | |
avoid hash lookups and remove depency on the instance
|
| |
| |
| |
| | |
we don't need to repeat if statements
|
| |
| |
| |
| |
| | |
now we only have to look up @scope[:scope_level] once per call to
canonical_action? and we don't have a variable named "flag"
|
| |
| |
| |
| |
| | |
since we pass `as` down, then we won't have to do an insert / delete
dance with the options hash
|
| |
| |
| |
| |
| | |
we know that this call only wants the path returned, so lets call a
method that returns the path.
|
| |
| |
| |
| | |
this allows us to avoid nil checks on the return value
|
| | |
|
| |
| |
| |
| |
| | |
there's no reason to to_sym the string if it doesn't match the regexp
anyway
|
| |
| |
| |
| | |
hash lookup should be faster than searching an array.
|
| |
| |
| |
| |
| | |
every call to default_resources_path_names allocates a new hash, no need
to dup
|
| | |
|
| |
| |
| |
| | |
this makes scope rollback much easier
|
| |
| |
| |
| | |
we can `super` in to the previous implementation.
|
| |
| |
| |
| |
| | |
we already know what helpers are path helpers, so just iterate through
that list and define the helpers with warnings
|
| | |
|
| |
| |
| |
| |
| | |
this lets us avoid hard coding a regexp for separating path and url
helpers in the clear! method.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Email does not support relative links since there is no implicit host. Therefore all links inside of emails must be fully qualified URLs. All path helpers are now deprecated. When removed, the error will give early indication to developers to use `*_url` methods instead.
Currently if a developer uses a `*_path` helper, their tests and `mail_view` will not catch the mistake. The only way to see the error is by sending emails in production. Preventing sending out emails with non-working path's is the desired end goal of this PR.
Currently path helpers are mixed-in to controllers (the ActionMailer::Base acts as a controller). All `*_url` and `*_path` helpers are made available through the same module. This PR separates this behavior into two modules so we can extend the `*_path` methods to add a Deprecation to them. Once deprecated we can use this same area to raise a NoMethodError and add an informative message directing the developer to use `*_url` instead.
The module with warnings is only mixed in when a controller returns false from the newly added `supports_relative_path?`.
Paired @sgrif & @schneems
|
| |
| |
| |
| | |
use helpers.include? so we don't get any false positives
|
| |
| |
| |
| |
| | |
we should not be accessing internals to figure out if a method is
defined.
|
| |
| |
| |
| |
| | |
since helpers is a set, we can be confident about when to remove methods
from the module.
|
| |
| |
| |
| | |
after this, we can disconnect @module from the instance
|
| |
| |
| |
| | |
we can cache the module on the stack, then reuse it
|
| | |
|
| |
| |
| |
| |
| | |
we know the routes should not be "optimized" when mounting an
application
|
| |
| |
| |
| |
| | |
this caching doesn't increase performance, but does increase complexity.
remove it for now and find better ways to speed up this code.
|