| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| | |
Fix Hash#deep_merge bug and improve documentation — resolves #12738
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously merging into a hash with a falsy value would not result in
the merge-block being called. The fix is simply to check for presence
of the key in the hash.
The documentation example for `deep_merge` now appropriately
demonstrates what a deep merge does.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Strips leading underscores.
* Changes some unnecessary gsub!s to sub!s.
* Replaces some anchors ^, $ with \A, \z.
* Documents that human inflection rules are applied.
* Documents that words are downcased except acronyms.
* Adds an example with an acronym.
* Rewords docs.
|
| | |
|
| | |
|
|\ \
| | |
| | | |
[Fixes #14948] Hash#to_query: right serialization for empty hash and array
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
are serialized
Empty Hash or Array should not present in serialization result
{a: []}.to_query # => ""
{a: {}}.to_query # => ""
For more info see #14948.
|
|/ /
| |
| |
| | |
test case.
|
| | |
|
|\ \
| | |
| | | |
Correct comment [ci skip]
|
| | | |
|
|\ \ \
| | | |
| | | | |
Fix inconsistent behavior from String#pluralize
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Before:
When calling String#pluralize with count=1 then it returned same
string, but with count other than 1, returned new string.
After:
String#pluralize always return a new string.
=> Prevent mutation of a string inadvertently.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
After this 21dbe6f39b57f52967e92716dbd5e2b894e7a64c
2.1.1 :001 > 'business'.classify
=> "Business"
2.1.1 :004 > 'calculus'.classify
=> "Calculu"
2.1.1 :005 >
|
| |/ /
|/| | |
|
| | | |
|
|\ \ \
| | | |
| | | | |
multibyte_conformance.rb --> multibyte_conformance_test.rb
|
| |/ / |
|
|/ / |
|
| |
| |
| |
| |
| |
| |
| | |
While calling String#first or String#last with zero or a Fixnum < the
string's length returns a new string, a Fixnum >= the string's length
returns the string itself. This inconsistency can lead to inadvertent
mutation of a string.
|
|\ \ |
|
| | |
| | |
| | |
| | | |
[ci skip]
|
| | |
| | |
| | |
| | | |
[ci skip]
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
1. Improve tests
2. Remove unnecessary constant
3. Add docs for BigDecimal#duplicable?
|
| | | |
|
|\ \ \
| | | |
| | | | |
Improve debugging support
|
| | | | |
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Conflicts:
activerecord/CHANGELOG.md
activesupport/CHANGELOG.md
|
| |\ \ \ \
| | | | | |
| | | | | | |
Add tests to ActiveSupport:XmlMini to_tag method
|
| | | | | | |
|
| |\ \ \ \ \
| | | | | | |
| | | | | | | |
Active support callback's before/after/around filters are not correctly making their singleton methods private
|
| | | | | | | |
|
| | | | | | | |
|
| | |_|/ / /
| |/| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This fixes:
1.second.eql?(1.second) #=> false
The new `eql?` requires that `other` is an `ActiveSupport::Duration`.
This requirement makes `ActiveSupport::Duration`'s behavior consistent
with other numeric types in Ruby.
1.eql?(1.0) #=> false
1.0.eql?(1) #=> false
1.second.eql?(1) #=> false (was true)
1.eql?(1.second) #=> false
{ 1 => "foo", 1.0 => "bar" }
#=> { 1 => "foo", 1.0 => "bar" }
{ 1 => "foo", 1.second => "bar" }
# now => { 1 => "foo", 1.second => "bar" }
# was => { 1 => "bar" }
And though the behavior here hasn't changed, for reference:
1 == 1.0 #=> true
1.0 == 1 #=> true
1 == 1.second #=> true
1.second == 1 #=> true
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Auto-generate stable fixture UUIDs on PostgreSQL
Conflicts:
activerecord/CHANGELOG.md
activerecord/lib/active_record/fixtures.rb
activerecord/test/cases/adapters/postgresql/uuid_test.rb
activesupport/CHANGELOG.md
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Fixes: #11524
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Active support instead of ActiveSupport::Deprecation.silence we can use assert_deprecated
|
| | |_|_|/ /
| |/| | | |
| | | | | |
| | | | | | |
assert_deprecated
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
It was causing error when using `with_options` passing a lambda as its
last argument.
class User < ActiveRecord::Base
with_options dependent: :destroy do |assoc|
assoc.has_many :profiles, -> { where(active: true) }
end
end
It was happening because the `option_merger` was taking the last
argument and checking if it was a Hash. This breaks the HasMany usage,
because its last argument can be a Hash or a Proc.
As the behavior described in this test:
https://github.com/rails/rails/blob/master/activesupport/test/option_merger_test.rb#L69
the method will only accept the lambda, this way it will keep the expected behavior. See 9eaa0a34
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Change to require all active_support/deprecation since that's the actual
entry point for the deprecation methods.
|
| | | | | | |
|
| | | | | | |
|
|/ / / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Make `#prepend` method modify instance in-place and return self
instead of just returning modified value. That is exactly what
`#prepend!` method was doing previously, so it's deprecated from
now on.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
In particular, `.new`, `#update`, `#merge`, `#replace` all accept
objects which respond to `#to_hash`, even if those objects are not
Hashes directly.
|
| | | | |
| | | | |
| | | | |
| | | | | |
actually doesn't increment/decrement in localstore.
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Closes #14405.
This is a follow-up to 9e997e9039435617b6a844158f5437e97f6bc107 to restore
the documented behavior.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Conflicts:
activesupport/lib/active_support/core_ext/hash/conversions.rb
|