| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
| | |
| | |
| | |
| | |
| | | |
claudiob/replace-slower-block-call-with-faster-yield
Replace (slower) block.call with (faster) yield
|
| | |
| | |
| | |
| | | |
This reverts commit 0ab075e75f58bf403f7ebe20546c7005f35db1f6.
|
|\ \ \ |
|
| |\ \ \
| | |/ /
| |/| | |
[ci skip] Add Doc of with_options for the case when inherited default options and original options have same keys
|
| | | |
| | | |
| | | |
| | | | |
options and original options have same keys
|
| |\ \ \
| | | | |
| | | | |
| | | | |
| | | | | |
claudiob/replace-slower-block-call-with-faster-yield
Replace (slower) block.call with (faster) yield
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Performance optimization: `yield` with an implicit `block` is faster than `block.call`.
See http://youtu.be/fGFM_UrSp70?t=10m35s and the following benchmark:
```ruby
require 'benchmark/ips'
def fast
yield
end
def slow(&block)
block.call
end
Benchmark.ips do |x|
x.report('fast') { fast{} }
x.report('slow') { slow{} }
end
# => fast 154095 i/100ms
# => slow 71454 i/100ms
# =>
# => fast 7511067.8 (±5.0%) i/s - 37445085 in 4.999660s
# => slow 1227576.9 (±6.8%) i/s - 6145044 in 5.028356s
```
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Since some headers can appear multiple times in an email it's required
to set it to nil first when you want to overwrite an existing one.
This commit add some information about this process.
Fix #15912
|
| | | | |
| | | | |
| | | | |
| | | | | |
options and original options have same keys
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Performance optimization: `yield` with an implicit `block` is faster than `block.call`.
See http://youtu.be/fGFM_UrSp70?t=10m35s and the following benchmark:
```ruby
require 'benchmark/ips'
def fast
yield
end
def slow(&block)
block.call
end
Benchmark.ips do |x|
x.report('fast') { fast{} }
x.report('slow') { slow{} }
end
# => fast 154095 i/100ms
# => slow 71454 i/100ms
# =>
# => fast 7511067.8 (±5.0%) i/s - 37445085 in 4.999660s
# => slow 1227576.9 (±6.8%) i/s - 6145044 in 5.028356s
```
|
|\ \ \ \
| |/ / /
|/| | | |
Add necessary 'require reverse_merge' to HAWI.rb
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Hashes with indifferent access should support `reverse_merge` out-of-the-box
but they don't; for instance the following code fails:
```ruby
require 'active_support'
require 'active_support/hash_with_indifferent_access'
hash = HashWithIndifferentAccess.new key: :old_value
hash.reverse_merge key: :new_value
```
This PR fixes the case above by simply requiring
`active_support/core_ext/hash/reverse_merge` in `hash_with_indifferent_access.rb`
and adding a test that confirms the fix.
---
Here are more details about the bugfix.
Currently, `reverse_merge` is [defined in HashWithIndifferentAccess](https://github.com/rails/rails/blob/4e8ea13ba1a0870905a46fac5f232d9f41eef8a4/activesupport/lib/active_support/hash_with_indifferent_access.rb#L208)
by invoking `super`, that is by invoking `Hash#reverse_merge`:
```ruby
def reverse_merge(other_hash)
super(self.class.new_from_hash_copying_default(other_hash))
end
```
However, Ruby's `Hash` does not have the `reverse_merge` by default: it must be
added by ActiveSupport, and that requires the following line of code to be
present:
```ruby
require 'active_support/core_ext/hash/reverse_merge'
```
|
|\ \ \
| | | |
| | | | |
Add a deprecation warning for abiguous boolean values
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
In Rails 5.0, we'd like to change the behavior of boolean columns in
Rails to be closer to Ruby's semantics. Currently we have a small set
of values which are "truthy", and all others are "falsy". In Rails 5.0,
we will reverse this to have a small number of values which are "falsy",
and all others will become "truthy".
In the interim, all values which are ambiguous must emit a deprecation
warning.
|
| | | |
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | | |
yuki24/another-improvements-for-dynamic-error-pages
A warning line should look like a warning section in Guides
|
| | | |
| | | |
| | | |
| | | | |
[ci skip]
|
|\ \ \ \
| | | | |
| | | | | |
Clarify wording in Rails HTML Sanitizer section [ci skip]
|
|/ / / /
| | | |
| | | | |
[ci skip]
|
|\ \ \ \
| | | | |
| | | | | |
Fix example code for `Rails::Generators::Testing::Behaviour` [ci skip]
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
`cleanup_destination_root` method is not found anywhere.
Instead, `prepare_destination` clean up distination root on setup.
|
|/ / / / |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Closes #17197.
Closes #17207.
`{required}` is a type modifier so it should be:
user:references{required}:index
and not:
user:references:index{required}
|
|\ \ \ \
| | | | |
| | | | | |
mention the :without option [ci skip]
|
| | | | |
| | | | |
| | | | | |
As pointed out in the ActiveModel::Validations::HelperMethods #validates_format_of documentation.
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
clarify debugger platform invocation
|
| | | | | |
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The behavior has changed since 4.1 and non-array values are no
longer type casted to a blank array. This way the user can define
custom validations on that property.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
[ci skip] add AC::InvalidCrossOriginRequest to list of rescue_responses default
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
/cc @sgrif
|
| | | | | | |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
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
|