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.
1. Improve tests 2. Remove unnecessary constant 3. Add docs for BigDecimal#duplicable?
…ault Improve debugging support
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
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.
…rs requires. Appropriate to keep this, users don't care that the implementation got unified.
…as good, but the closer relationship to #presence over #present is ultimately worth it
Add note to silence_stream and quietly. [skip ci]
State that on the doc. [fixes #11954]
Conflicts: guides/source/active_record_validations.md guides/source/api_documentation_guidelines.md guides/source/configuring.md
This was backported for Ruby 1.8 support and is no longer needed. Signed-off-by: David Celis <firstname.lastname@example.org>
Rails currently provides an extension to BigDecimal that redefines how it is serialized to YAML. However, as noted in #12467, this does not work as expected. When ActiveSupport is required, BigDecimal YAML serialization does not maintain the object type. It instead ends up serializing the number represented by the BigDecimal itself which, when loaded by YAML later, becomes a Float: ```ruby require 'yaml' require 'bigdecimal' yaml = BigDecimal('13.37').to_yaml YAML.load(yaml).class require 'active_support/all' yaml = BigDecimal('13.37').to_yaml YAML.load(yaml).class ``` @tenderlove posits that we should deprecate the custom BigDecimal serialization and let Ruby handle it. For the time being, users who require this serialization for backwards compatibility can manually `require 'active_support/core_ext/big_decimal/yaml_conversions'`. This will close #12467 and deprecate the custom BigDecimal#to_yaml. Signed-off-by: David Celis <email@example.com>