| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
|
| |
| |
| |
| | |
These requires were added only to change deprecation message
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
doesn't contain `#`
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously, if you tried to use form_for with a presenter object
that implements to_model, it would crash in
action_dispatch/routing/polymorphic_routes.rb when asking the presenter
whether it is .persisted?
Now, we always ask .persisted? of the to_model object instead.
This seems to been an issue since 1606fc9d840da869a60213bc889da6fcf1fdc431
Signed-off-by: Eugenia Dellapenna <eugenia.dellapenna@gmail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The methods in these modules are not used anywhere. They used to be
invoked in polymorphic_routes.rb but their usage was removed in e821045.
What is your opinion about removing these methods?
They do belong to the public API, but in reality their code has already been duplicated to ActionView::ModelNaming, since they are used by methods like `dom_id` and `dom_class` to associated records with DOM elements (in
ActionView).
Please tell me if you think that removing this module is a good idea and,
in that case, if the PR is okay as it is, or you'd rather start by showing
a deprecation message, and remove the module in Rails 5.1.
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
There is no need to subtract one from the path_params size when there is
no format parameter because it is not present in the path_params array.
Fixes #17819.
|
| |
| |
| |
| | |
Also avoid using try since is_a? is faster for this case.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This fixes a regression in 4.2.0 from 4.1.8.
https://github.com/rails/rails/pull/17823 fixed a similar regression regarding _explicitly_ named routes for a mounted Rack app, but there was another regression for the default value.
With a route like:
Rails.application.routes.draw do
mount Mountable::Web, at: 'some_route'
end
The "Prefix" column of rake routes gives the following:
- 4.1.8: mountable_web
- 4.2.0.beta1-4: [nothing]
- 4.2.0.rc1: [nothing]
- 4.2.0.rc2: some_route <- regression
This fixes the default to go back to being based off the name of the class like the docs specify: https://github.com/rails/rails/blob/785d04e3109f69d0b9b9f4732179592f0ef04e52/actionpack/lib/action_dispatch/routing/mapper.rb#L558-L560
Explicitly named routes still work correctly per https://github.com/rails/rails/pull/17823:
Rails.application.routes.draw do
mount Mountable::Web, at: 'some_route', as: 'named'
end
- 4.1.8: named
- 4.2.0.beta1-4: [nothing]
- 4.2.0.rc1: [nothing]
- 4.2.0.rc2: named
|
| |
| |
| |
| | |
`_generate_paths_by_default` should always be private.
|
|\ \
| | |
| | | |
Pure rack apps can be mounted with a name
|
| | |
| | |
| | |
| | | |
See https://github.com/rails/rails/commit/9b15828b5c347395b42066a588c88e5eb4e72279#commitcomment-8764492
|
|/ / |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Closes #17615 #17616
when script_name is nil in the options hash, script_name is set to nil.
options = {script_name: nil}
script_name = options.delete(:script_name) {‘’} # => nil
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | | |
Fixes https://github.com/rails/rails/issues/16958
[Byron Bischoff & Melanie Gilman]
|
|/ / |
|
| |
| |
| |
| | |
[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
|