| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
The same information is stored in the `@scope` linked list, so just get
it from there.
|
|
|
|
| |
this lets us remove the setter and make the Resource object Read-Only
|
|
|
|
|
| |
We don't need to ask `scope` for the resource because we already have it
right here.
|
|
|
|
| |
Related with dc1b937db780155089fce522f03d340e62f5df36
|
|
|
|
|
|
| |
eliminates calling `scope` in one method, pushes the other calls up one
frame. This goes a little way towards eliminating the internal calls to
`scope`.
|
|
|
|
| |
we don't really need this hash.
|
|
|
|
|
|
|
| |
we need to get a grip on what `scope` actually does. This commit
removes some of the internal calls to `scope`. Eventually we should add
public facing methods that provide the API that `scope` is trying to
accomplish.
|
|
|
|
|
|
|
| |
`Dispatcher` doesn't need to hold on to the defaults hash. It only used
the hash to determine whether or not it should raise an exception if
there is a name error. We can pass that in further up the stack and
alleviate Dispatcher from knowing about that hash.
|
|
|
|
|
|
| |
We know in advance whether the object is a dispatcher or not, so we can
configure the Constraints object with a strategy that will call the
right method.
|
|
|
|
| |
it isn't used.
|
|
|
|
|
|
|
|
|
|
|
| |
Add descriptions about `ActiveRecord::Base#to_param` to
* `ActionDispatch::Routing::Base#match`
* Overriding Named Route Parameters (guide)
When passes `:param` to route definision, always `to_param` method of
related model is overridden to constructe an URL by passing these
model instance to named_helper.
|
|
|
|
|
|
|
| |
The `dup` was introduced by c4106d0c08954b0761726e0015ec601b7bc7ea4b
to work around a frozen key. Nowadays, the string is already being
duplicated by the `tr` in `options[:action] ||= action.tr('-', '_')`
and later joined into a new string in `name_for_action`.
|
| |
|
|
|
|
|
|
| |
match method without setting `:via` option has been deprecated
fix minor typo
|
| |
|
| |
|
|\
| |
| | |
A shorter and more concise version of select..size
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Shorthand route match is when controller and action are taken literally from path.
E.g.
get '/foo/bar' # => will use 'foo#bar' as endpoint
get '/foo/bar/baz' # => will use 'foo/bar#baz' as endpoint
Not any path with level two or more of nesting can be used as shortcut.
If path contains any characters outside of /[\w-]/ then it can't be
used as such.
This commit ensures that invalid shortcuts aren't used.
':controller/:action/postfix' - is an example of invalid shortcut
that was previosly matched and led to exception:
"ArgumentError - ':controller/:action' is not a supported controller name"
|
| | |
|
| |
| |
| |
| | |
These requires were added only to change deprecation message
|
| |
| |
| |
| | |
doesn't contain `#`
|
| |
| |
| |
| | |
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
|
| |
| |
| |
| | |
See https://github.com/rails/rails/commit/9b15828b5c347395b42066a588c88e5eb4e72279#commitcomment-8764492
|
| | |
|
| |
| |
| |
| | |
[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.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
https://github.com/rails/rails/commit/402c2af55053c2f29319091ad21fd6fa6b90ee89
introduced a regression that caused any constraints added to redirect routes
to be ignored.
Fixes #16605
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| | |
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.
|
| | |
|
| |
| |
| |
| | |
this makes scope rollback much easier
|
| |
| |
| |
| |
| | |
we know the routes should not be "optimized" when mounting an
application
|
| |
| |
| |
| | |
this way we only have to test for whether it is a rails app once.
|
| |
| |
| |
| |
| | |
Use an is_a check to ensure it's a Railsish app so we can avoid
respond_to calls everywhere.
|