| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
remove unneeded file from Railties.
|
| | |
|
|\ \
| | |
| | | |
use require_command! instead of calling its definition
|
| |/ |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
In the DSL you can now do:
create_table(:foos) do |t|
t.bigint :hi
end
|
|\ \
| | |
| | | |
Fix typo in actionpack/lib/action_dispatch/routing/mapper.rb [ci-skip]
|
|/ / |
|
| | |
|
|\ \
| | |
| | |
| | | |
Raise an error for has_one associations which try to go :through a polymorphic association
|
| |/
| |
| |
| | |
polymorphic association [#17263]
|
|\ \
| | |
| | | |
ActionController::InvalidCrossOriginRequest fails with 422 instead of 500
|
| | |
| | |
| | |
| | | |
Fixes #15967
|
|\ \ \
| | | |
| | | | |
Fix how file_ and password_field_tag edit options
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This commit fixes the behavior of `file_field_tag` and `password_field_tag`
when invoked with a hash of options.
These two helpers are different from all the other ones in that they modify the
options hash passed as a parameter, whereas all the other helpers duplicate it
before updating it.
The result is that *bad things* can happen if the user re-uses the same hash.
For instance, users who write the following code to display a file field
followed by a text field (both with the same class):
```rhtml
<% options = {class: 'important'} %>
<%= file_field_tag 'Upload', options %>
<%= text_field_tag 'Name', options %>
```
would instead see **two file fields!**
```html
<input class="important" id="Upload" name="Upload" type="file">
<input class="important" id="Name" name="Name" type="file" value="value">
```
This PR replaces `update` with `merge` in the code of the two helpers,
fixing the issue above.
The included test verifies the change, since it passes after this PR, but
fails before with the following error:
```
Expected: <input type="text" name="title" id="title" value="Hello!" class="important" />
Actual: <input type="password" name="title" id="title" value="Hello!" class="important" />
```
|
|\ \ \
| | | |
| | | | |
delete leftover JoinOperation struct
|
| | |/
| |/| |
|
|\ \ \
| | | |
| | | | |
Remove duplicate stringify_keys in text_field_tag and number_field_tag
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
All the methods that invoke `text_field_tag` (such as `hidden_field_tag`)
and all the methods that invoke `number_field_tag` (that is `range_field_tag`)
do not need to call `stringify_keys` on their `options` parameter since the
`text_field_tag` method [is already doing it internally](https://github.com/claudiob/rails/blob/4159134524f4c78d008eef9d9a17f73a3172dcc8/actionview/lib/action_view/helpers/form_tag_helper.rb#L182):
```ruby
def text_field_tag(name, value = nil, options = {})
tag :input, { "type" => "text", "name" => name, "id" => sanitize_to_id(name), "value" => value }.update(options.stringify_keys)
end
```
and `number_field_tag` is [already doing it internally](https://github.com/claudiob/rails/blob/e3207bdbba55f3806441f22b175557579bc0b051/actionview/lib/action_view/helpers/form_tag_helper.rb#L780) as well:
```ruby
def number_field_tag(name, value = nil, options = {})
options = options.stringify_keys
...
end
[Note #1: My code uses `merge` to respect the existing behavior of
duplicating the `options` hash before updating its keys, see https://github.com/rails/rails/pull/17096#issuecomment-57223827]
[Note #2: My code uses symbols instead of strings (e.g.: `:hidden`) to look
forward to future version of Ruby/Raiks (GC symbols); the result of the method,
however, is the same, because the symbols are stringified inside `text_field_tag`]
[Note #3: I had previously created a similar PR #17096 but decided to
split it into multiple PRs given the feedback received in the comments]
|
|\ \ \ \
| | | | |
| | | | | |
Use `#tr` instead of `#gsub` in Journey scanner
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
`#tr` is more efficient than `#gsub` and can be used as a drop in
replacement in this context.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Add ActiveJob to "Welcome to Rails" section
|
| | |/ / /
| |/| | |
| | | | |
| | | | | |
[ci skip]
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Link to ActiveModel’s README in "Welcome to Rails"
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
A link to the README of each module is included in "Welcome to Rails",
only ActiveModel (and ActiveJob, see #17264) are missing.
[ci skip]
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Remove broken http://tore.darell.no link
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Replace with Twitter account, unless @toretore has a better
suggestion :ear since http://tore.darell.no returns 404.
[ci skip]
|
|\ \ \ \ \
| |_|_|/ /
|/| | | | |
specify protocol for external links to json project
|
|/ / / /
| | | |
| | | |
| | | | |
to ensure correct parsing result of rdoc
|
| | | |
| | | |
| | | | |
The intention here is to make the required config copy-able from the console/logs, so add a newline at the end of the message to make that easier. (Otherwise it would be `... raise_in_transactional_callbacks = true (called from...`.)
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
follow up for #17052
|
| |/ /
|/| |
| | |
| | |
| | | |
For now, we don't want to take "scoping" calls in to account when
calculating cache keys for relations, so just opt-out.
|
|\ \ \
| |_|/
|/| | |
Improve Journey compliance to RFC 3986
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The scanner in Journey fails to recognize routes that use literals
from the sub-delims section of RFC 3986.
This commit enhance the compatibility of Journey with the RFC by
adding support of authorized delimiters to the scanner.
Fix #17212
|
|\ \
| | |
| | | |
Add #key? to ActiveModel::Errors
|
| | |
| | |
| | |
| | | |
Mirror Ruby's Hash#key?
|
|\ \ \
| |/ /
|/| | |
[ci skip] Clarify `#update_all` doc about values processing
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| | |
This clarify the fact that `#update_all` doesn't type-cast passed
values and that these values are written as-is in the SQL DB.
Fix #17242
[ci skip]
|
|\ \
| | |
| | | |
Remove duplicate error message "Couldn't find..."
|
| |/
| |
| |
| |
| |
| |
| |
| |
| | |
This commit removes the duplication of the error message:
> Couldn't find #{@klass.name} with [#{arel.where_sql}]
introduced in #15791 by adding a private method `find_nth!` that
deals with all the method like `first!` and `second!`.
|
| |
| |
| |
| |
| | |
emit an event when we instantiate AR objects so we can see how many
records were instantiated and how long it took
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
It was changed to not set the cookie in get requests at
https://github.com/rails/turbolinks/commit/62cc3db457ad9745ccda047dd43ab84fb3d89707.
Related with dcb05f26.
|
| | |
|
|\ \
| | |
| | | |
Autosave callbacks shouldn't be `after_save` callbacks
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
068f092ced8483e557725542dd919ab7c516e567 registered autosave callbacks
as `after_save` callbacks. This caused the regression described in #17209.
Autosave callbacks should be registered as `after_update` and
`after_create` callbacks, just like before.
This is a partial revert of 068f092ced8483e557725542dd919ab7c516e567.
Fixes #17209.
|
| | |
| | |
| | |
| | | |
Also add documentation on it
|
| | | |
|