| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|\
| |
| | |
Remove deprecated catch-all route in the AV tests
|
| |
| |
| |
| |
| |
| |
| |
| | |
This commit removes a deprecated catch-all route in the AV tests. It
defines and includes the necessary routes for each test such that we
don't need the catch-all anymore.
This also helps push us toward #33970
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In Ruby 2.3 or later, `String#+@` is available and `+@` is faster than `dup`.
```ruby
# frozen_string_literal: true
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
gem "benchmark-ips"
end
Benchmark.ips do |x|
x.report('+@') { +"" }
x.report('dup') { "".dup }
x.compare!
end
```
```
$ ruby -v benchmark.rb
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
Warming up --------------------------------------
+@ 282.289k i/100ms
dup 187.638k i/100ms
Calculating -------------------------------------
+@ 6.775M (± 3.6%) i/s - 33.875M in 5.006253s
dup 3.320M (± 2.2%) i/s - 16.700M in 5.032125s
Comparison:
+@: 6775299.3 i/s
dup: 3320400.7 i/s - 2.04x slower
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use attr_reader/attr_writer instead of methods
method is 12% slower
Use flat_map over map.flatten(1)
flatten is 66% slower
Use hash[]= instead of hash.merge! with single arguments
merge! is 166% slower
See https://github.com/rails/rails/pull/32337 for more conversation
|
|
|
|
|
|
| |
With the disabling of TLS 1.0 by most major websites, continuing to run
IE8 or lower becomes increasingly difficult so default to not enforcing
UTF-8 encoding as it's not relevant to other browsers.
|
|
|
|
|
|
|
|
|
|
| |
module_name/class_name
Currently submit_tag value translation does not support i18n key style
locale key.
It confuses me a bit because many other components support i18n key
style locale key.
I added i18n key style locale key support to submit tag.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`BigDecimal.new` has been deprecated in BigDecimal 1.3.3
which will be a default for Ruby 2.5.
Refer
https://github.com/ruby/bigdecimal/commit/533737338db915b00dc7168c3602e4b462b23503
* This commit has been made as follows:
```
cd rails
git grep -l BigDecimal.new | grep -v guides/source/5_0_release_notes.md | grep -v activesupport/test/xml_mini_test.rb | xargs sed -i -e "s/BigDecimal.new/BigDecimal/g"
```
- `activesupport/test/xml_mini_test.rb`
Editmanually to remove `.new` and `::`
- guides/source/5_0_release_notes.md
This is a Rails 5.0 release notes.
|
|
|
|
|
|
|
| |
The def with blank `()` was newly added in #31176, but we have not used
the blank `()` style in most part of our code base.
So I've enabled `Style/DefWithParentheses` to prevent to newly added the
code.
|
|
|
|
| |
form_with_generates_ids
|
|
|
|
| |
And enable `context_dependent` of Style/BracesAroundHashParameters cop.
|
|
|
|
| |
Also make sure file_field doesn't mutate the original options passed in.
|
| |
|
|
|
|
|
|
|
| |
We have some indentation cops. But now there is a little inconsistent
params indentations. Enable `Layout/FirstParameterIndentation` cop to
prevent newly inconsistent indentation added and auto-correct to
existing violations.
|
| |
|
|
|
|
|
| |
This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing
changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
|
|\
| |
| |
| | |
Enforce frozen string in Rubocop
|
| | |
|
|/
|
|
| |
Plus a couple of related ActionPack patches.
|
| |
|
|
|
|
| |
empty lines
|
|
|
|
| |
(I personally prefer writing one string in one line no matter how long it is, though)
|
|\
| |
| | |
do not mutate `object_name` of class in `fields_for`
|
| |
| |
| |
| |
| |
| | |
Since it affects the entire form, should not mutate `object_name` of class.
Fixes #26931
|
|/
|
|
|
|
| |
Some methods were added to public API in
5b14129d8d4ad302b4e11df6bd5c7891b75f393c and they should be not part of
the public API.
|
| |
|
| |
|
| |
|
|\
| |
| | |
improve error message when include assertions fail
|
| |
| |
| |
| |
| |
| | |
assert [1, 3].includes?(2) fails with unhelpful "Asserting failed" message
assert_includes [1, 3], 2 fails with "Expected [1, 3] to include 2" which makes it easier to debug and more obvious what went wrong
|
|/
|
|
|
|
|
|
|
|
|
| |
Commit d270da569 changed the `form_for` API from `:object_name` to `:as`.
It also change the related test body, but not its title, which is changed here.
See https://github.com/rails/rails/commit/d270da569efeabd7cd563028816452236713aa9f#diff-52455f1e82acf12551bc5e7e26b82008
I realize this is a small commit but I was having trouble understanding what
the test was about since there is no "object_name" in the code.
I imagine the same may happen to other developers, therefore this commit.
|
|
|
|
|
|
|
|
| |
Style/SpaceBeforeBlockBraces
Style/SpaceInsideBlockBraces
Style/SpaceInsideHashLiteralBraces
Fix all violations in the repository.
|
|
|
|
| |
Hash syntax auto-correcting breaks alignments. 411ccbdab2608c62aabdb320d52cb02d446bb39c
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
|
|
|
|
|
|
|
|
|
|
|
| |
A change was made in the helper that renders the `datetime`,
being now by default `datetime-local` and creating
an alias of `datetime-local` for `datetime`, `datetime` tag and
it passes to be an abstract class for all other tags that inherit from him.
As a new specification of the HTML 5 the text field type `datetime`
will no longer exist and will pass a `datetime-local`.
Ref: https://html.spec.whatwg.org/multipage/forms.html#local-date-and-time-state-(type=datetime-local)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The reason we are reverting this commit is because it created breaking
changes for file upload gems. For more information see discussion here:
https://github.com/rails/rails/issues/17947#issuecomment-225154294
This reverts commit c455817804e4df64c46c17a0cdec0e5a1ca5ba2e, reversing
changes made to 8b3cd74b8a09ef85a43d7631bb062a9ec7f57227.
Conflicts:
actionview/CHANGELOG.md
actionview/lib/action_view/helpers/form_helper.rb
|
|
|
|
|
| |
Datetime input type was removed from HTML specification.
One can use `datetime_local_field` and `datetime_local_field_tag` instead.
|
|
|
|
|
|
|
|
|
|
| |
stevenspiel/titleize_model_name_for_default_submit_button_value"
This reverts commit 4158974c60d817c9bc1e2aecb342161295f2ac0d, reversing
changes made to 3d590add45b7ff1de972d99b076cb504d5208935.
Reason: This break i18n in some languages. See
https://github.com/rails/rails/issues/791#issuecomment-192724640
|
|
|
|
|
|
| |
of html_safe in favour of raw() in AV helpers.
Also changed usage of html_safe to make use of raw() instead so that the intended behaviour is verified with raw()
|
|\
| |
| |
| |
| | |
stevenspiel/titleize_model_name_for_default_submit_button_value
titleize the model name on default submit buttons
|
| | |
|
|/
|
|
|
|
| |
the radios
Fixes #22773
|
|
|
|
|
|
|
| |
According to the W3 spec[1] the value should use a 1-based index
and not a 0-based index for the week number.
[1]: http://www.w3.org/TR/html-markup/datatypes.html#form.data.week
|
|\
| |
| | |
Fix a faulty form_for test
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Stumbled upon this one while trying to deprecate the String/Symbol
passing to `form_for`.
This test passed on an accident, because the signature of `form_for`
currently accepts 2 positional arguments and a block. Calling it with
the wrong number of arguments caused:
```ruby
(byebug) form_for(:post, @post, html: { id: 'create-post' })
*** ArgumentError Exception: wrong number of arguments (3 for 1..2)
```
This made the test pass, because it was still an `ArgumentError`. :-)
|