aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/CHANGELOG.md
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | Use block parameter rather than `$1` during `gsub!` so ↵Mark J. Titorenko2014-05-121-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `ActiveSupport::SafeBuffer` values aren't mangled. Fixes #15064
* | | | | | Make TimeZone#parse behave more like Time#parse.Ulysse Carion2014-05-111-0/+6
|/ / / / / | | | | | | | | | | | | | | | | | | | | Namely, if the mday is omitted but any other upper components are, then instead of supplying the mday from the current time, it defaults to 1.
* | | | | several enhancements to humanize [closes #12288]Xavier Noria2014-05-061-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | | | | Improve CHANGELOG [ci skip]Rafael Mendonça França2014-05-041-2/+2
| | | | |
* | | | | [Fixes #14948] Hash#to_query: Changed a way how empty hash and empty array ↵Bogdan Gusiev2014-05-031-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | are serialized Empty Hash or Array should not present in serialization result {a: []}.to_query # => "" {a: {}}.to_query # => "" For more info see #14948.
* | | | | Merge branch 'master' into rm-uuid-fixturesRafael Mendonça França2014-04-101-0/+34
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: activerecord/CHANGELOG.md activesupport/CHANGELOG.md
| * | | | | Fixed problem where `1.day.eql?(1.day)` is falseEmily Dobervich2014-04-081-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | | Merge pull request #12016 from roderickvd/uuid_fixesRafael Mendonça França2014-04-041-0/+5
|\ \ \ \ \ \ | |/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | | | Auto-generate stable fixture UUIDs on PostgreSQL.Roderick van Domburg2014-01-071-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | Fixes: #11524
* | | | | | Make AS::SafeBuffer#prepend act like String#prependPavel Pravosud2014-03-311-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | HashWithIndifferentAccess better respects #to_hashPeter Jaros2014-03-281-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In particular, `.new`, `#update`, `#merge`, `#replace` all accept objects which respond to `#to_hash`, even if those objects are not Hashes directly.
* | | | | | Deprecate Class#superclass_delegating_accessorAkshay Vishnoi2014-03-201-0/+4
| | | | | |
* | | | | | Fix #to_json for BasicObject EnumerablesSammy Larbi2014-03-141-0/+5
| | | | | |
* | | | | | Revert "Merge pull request #14269 from arthurnn/expanded_key_array"Godfrey Chan2014-03-041-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 475c96589ca65282e1a61350271c2f83f0d4044f, reversing changes made to 705915ab5cf24430892107764b0050c07e1df583. We decided that this is not worth busting everyone's cache as this seems like a very unlikely problem. The problem only occurs when the user is 1) not using a namespace, or 2) using the same namesapce for different *kinds* of cache items. The recommended "fix" is to put those cache items into their own namspace: id = 1 Rails.cache.fetch(id, namespace: "user"){ User.find(id) } ids = [1] Rails.cache.fetch(ids, namespace: "users"){ User.find(ids) } See the discussion on #14269 for details.
* | | | | | Cache key should be different when is Array.Arthur Neves2014-03-031-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `cache.fetch(['foo'])` and `cache.fetch('foo')` should generate different cache keys as they are not equivalents. [related #8615] [related #8614]
* | | | | | Return a hash rather than array from fetch_multiParker Selbert2014-02-261-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current implementation of `fetch_multi` returns an array and has no means to easily backtrack which names yielded which results. By changing the return value to a Hash we retain the name information. Hash#values can be used on the response if only the values are needed.
* | | | | | Point master changelogs to 4-1-stable branchCarlos Antonio da Silva2014-02-251-633/+1
| | | | | | | | | | | | | | | | | | | | | | | | Remove 4-1 related entries from master [ci skip]
* | | | | | Go with #presence_in instead of #present_in -- it doesnt sound quite as ↵David Heinemeier Hansson2014-02-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | good, but the closer relationship to #presence over #present is ultimately worth it
* | | | | | Introduce Concern#class_methods and Kernel#concernJeremy Kemper2014-02-231-0/+28
| | | | | |
* | | | | | Move changelog entry to the top, fix examples indent [ci skip]Carlos Antonio da Silva2014-02-181-10/+10
| | | | | |
* | | | | | Added Object#present_in to simplify value whitelistingDavid Heinemeier Hansson2014-02-181-0/+12
| | | | | |
* | | | | | time helpers honor the application time zone when passed a dateXavier Noria2014-02-181-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rails applications are expected to be always aware of the application time zone. To be consistent with that contract, we have to assume that a bare date passed to time helpers is a date in the application time zone, not in the system time zone. The system time zone is irrelevant, we should totally ignore it. For example, travel_to user.birth_date + 40.years should make that user be 40th years old regardless of the system time zone. Without this patch that may not be true.
* | | | | | Fix tidy_bytes for JRubyJustin Coyne2014-02-101-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous implementation was broken because JRuby (1.7.10) doesn't have a code converter for UTF-8 to UTF8-MAC.
* | | | | | synchronize 4.1 release notes with CHANGELOGS. [ci skip]Yves Senn2014-02-061-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | /cc @chancancode
* | | | | | Add CHANGELOG entryRafael Mendonça França2014-02-051-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | Closes #13909
* | | | | | Merge pull request #13911 from davidcelis/remove-bigdecimal-serializationRafael Mendonça França2014-02-011-1/+9
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Deprecate custom BigDecimal serialization Conflicts: activesupport/CHANGELOG.md
| * | | | | | Don't require BigDecimal serialization extensionDavid Celis2014-02-011-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <me@davidcel.is>
* | | | | | | Merge pull request #12769 from birkirb/masterRafael Mendonça França2014-02-011-0/+7
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Boolean parser blows up on a Fixnum. Conflicts: activesupport/CHANGELOG.md
| * | | | | | Fix breakage in XmlMiniBirkir A. Barkarson2013-12-231-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Boolean parsing breaks on non strings (i.e. integer 1|0) - Symbol parsing breaks on non strings. - BigDecimal parsing breaks due to missing require. - Update changelog.
* | | | | | | Maintain the current timezone in wrap_with_time_zoneAndrew White2014-01-311-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend the solution from the fix for #12163 to the general case where `Time` methods are wrapped with a time zone. Fixes #12596.
* | | | | | | Remove automatic removal of Date/Time stubs after each test caseRafael Mendonça França2014-01-301-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This behavior is only work out-of-box with minitest and also add a downside to run after each test case, even if we don't used the travel or travel_to methods
* | | | | | | Add `travel_back` to remove stubs from `travel` and `travel_to`Rafael Mendonça França2014-01-301-0/+4
| | | | | | |
* | | | | | | tidy CHANGELOGs [ci skip]Yves Senn2014-01-301-2/+2
| | | | | | |
* | | | | | | Fix documentation of new controller filters api [ci skip]Kassio Borges2014-01-291-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The api for filters with classes change and the guides weren't updated. Now the class must respond for methods with the same name as the filter, so the `before_action` calls a `before` method, and so on. The method `#filter` has been deprecated in 4.0.0 and has been removed in 4.1.0: #7560
* | | | | | | Add CHANGELOG entry for #11464Andrew White2014-01-261-0/+9
| | | | | | |
* | | | | | | Maintain current timezone when changing time during DST overlapAndrew White2014-01-261-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently if a time is changed during DST overlap in the autumn then the method `period_for_local` will return the DST period. However if the original time is not DST then this can be surprising and is not what is generally wanted. This commit changes that behavior to maintain the current period if it's in the list of periods returned by `periods_for_local`. It is possible to alter the behavior of `period_for_local` by specifying a second argument but since we may be change from another time that could be either DST or not then this would give inconsistent results. Fixes #12163.
* | | | | | | Adding Hash#compact and Hash#compact! methodstinogomes2014-01-091-0/+4
| |/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Adding Hash#compact and Hash#compact! methods * Using Ruby 1.9 syntax on documentation * Updating guides for `Hash#compact` and `Hash#compact!` methods * Updating CHANGELOG for ActiveSupport * Removing unecessary protected method and lambda for `Hash#compact` implementations * Performing `Hash#compact` implementation - https://gist.github.com/tinogomes/8332883 * fixing order position * Fixing typo
* | | | | | Fix typo in AS changelog, improve highlight [ci skip]Carlos Antonio da Silva2014-01-061-2/+2
| | | | | |
* | | | | | quick formatting pass through CHANGELOGS. [ci skip].Yves Senn2014-01-061-10/+15
| | | | | |
* | | | | | Add CHANGELOG entry for #10634 [ci skip]Andrew White2014-01-051-0/+17
| | | | | |
* | | | | | Raise if MemCacheStore doenst receive a Dalli objArthur Neves2014-01-031-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | :mem_cache_store should receive a list of hosts or a dalli client, otherwise raise it. Also adding a changelog.
* | | | | | Don't lazy load the tzinfo libraryAndrew White2014-01-011-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lazy loading the tzinfo library doesn't really buy us anything because the gem is installed as a dependency via the gemspec and if a developer is using Active Support outside of Rails then they can cherry pick which files to load anyway. Fixes #13553
* | | | | | Avoid raising a NameError on FreeBSD using DateRobin Dupret2014-01-011-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Date object has a xmlschema method starting with Ruby 1.9 so we were assuming that we could safely remove this method and redefine it later but the call to remove_method throws a NameError on FreeBSD so we should rely on remove_possible_method instead. This call is actually needed to avoid warnings when running the test suite. Fixes #11723
* | | | | | blank? and present? commit to return singletons [Xavier Noria & Pavel Pravosud]Xavier Noria2013-12-281-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The contract of blank? and present? was in principle to return Object, as we generally do, the test suite and description was consistent with that, but some examples had comments like "# => true". This cannot be unclear, we either fix the examples, or update the contract. Since users may be already assuming singletons due to the examples and the fact that they were returned before 30ba7ee, the safest option seems to be to revise the contract and the implementation of String#blank? The motivation for 30ba7ee was to improve the performance of the predicate, the refactor based on === is on par regarding speed. With this commit we start documenting return types using YARD conventions. We plan to document return types gradually.
* | | | | | Fix AS::NumberHelper results with large precisionsKenta Murata & Akira Matsuda2013-12-201-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | before: ActiveSupport::NumberHelper.number_to_rounded '3.14159', precision: 50 => "3.14158999999999988261834005243144929409027099609375" after: ActiveSupport::NumberHelper.number_to_rounded '3.14159', precision: 50 => "3.14159000000000000000000000000000000000000000000000"
* | | | | | Merge pull request #13367 from abhishekjain16/new_branchYves Senn2013-12-181-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | change to DateTime.civil_from_format from DateTime.civil_from_fromat in ... [ci skip]
| * | | | | | change to DateTime.civil_from_format from DateTime.civil_from_fromat in ↵abhishek2013-12-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | changelog [ci skip]
* | | | | | | Add changelog and upgrading notice related to I18n enforce_available_locales ↵Carlos Antonio da Silva2013-12-171-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | handling
* | | | | | | Fix indent on AS changelog [ci skip]Carlos Antonio da Silva2013-12-171-18/+18
| | | | | | |
* | | | | | | Introduce Module#concerningJeremy Kemper2013-12-171-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A natural, low-ceremony way to separate responsibilities within a class. Imported from https://github.com/37signals/concerning#readme