aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/CHANGELOG.md
Commit message (Collapse)AuthorAgeFilesLines
* 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
* | | Changelog improvements [ci skip]Carlos Antonio da Silva2013-12-121-1/+1
| | |
* | | Fix issue with Kernel#silence_stream leaking file descriptorsMario Visic2013-12-061-0/+4
| | | | | | | | | | | | | | | | | | | | | Calling Kernel#silence_stream creates a new file descriptor which isn't closed after it is used. As a result calling silence_stream multiple times leads to a build up of loose file descriptors and can cause issues in environments where garbage collection isn't run often.
* | | set `i18n.enforce_available_locales` before `i18n.default_locale`.Yves Senn2013-12-051-0/+5
| | |
* | | Backfilled CHANGELOG for AS::JSON::Variable removal (6f3e01e8) [ci skip]Godfrey Chan2013-12-031-0/+4
| | |
* | | Changelog improvements [ci skip]Carlos Antonio da Silva2013-12-031-1/+1
| | |
* | | Added Date#all_week/month/quarter/year for generating date rangesDimko2013-12-031-0/+4
| | |
* | | Add support for localized date referencesColin Bartlett2013-12-031-0/+7
| | | | | | | | | | | | | | | | | | | | | Ruby's Date class automatically gives us #yesterday, #today, and #tomorrow. And ActiveSupport has a handy Time.zone.today for getting a localized version. But there was no localized version of #yesterday or #tomorrow. Until now.
* | | Modify the Hash#assert_valid_keys error message so that it shows the valid ↵Nerian2013-12-031-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | keys. Also, show the wrong value as it was entered. { :failore => "stuff", :funny => "business" }.assert_valid_keys([ :failure, :funny ]) => ArgumentError: Unknown key: failore { 'failore' => "stuff", :funny => "business" }.assert_valid_keys([ :failure, :funny ]) => ArgumentError: Unknown key: failore { 'failore' => "stuff", :funny => "business" }.assert_valid_keys([ :failure, :funny ]) => ArgumentError: Unknown key: "failore". Valid keys are: :failure, :funny { :failore => "stuff", :funny => "business" }.assert_valid_keys([ :failure, :funny ]) => ArgumentError: Unknown key: :failore. Valid keys are: :failure, :funny Conflicts: activerecord/CHANGELOG.md Closes #11624.
* | | Merge pull request #13060 from chancancode/change_log_for_json_refactorCarlos Antonio da Silva2013-12-021-0/+16
|\ \ \ | | | | | | | | CHANGELOG for JSON refactor + added back the `encode_big_decimal_as_string` option with warning
| * | | Added back the `encode_big_decimal_as_string` option with warningGodfrey Chan2013-12-021-0/+16
| |/ / | | | | | | | | | | | | Also added the missing CHANGELOG entry for #12183 @ 80e7552073 and 4d02296cfb.
* / / Unify cattr and mattr accessors declarationsGenadi Samokovarov2013-12-021-0/+7
|/ /
* | first pass through CHANGELOGS to extract 4_1_release_notes. [ci skip]Yves Senn2013-11-281-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | Extract **notable changes**, **deprecations** and **removals** from each CHANGELOG. I tried to reference the commits and pull requests for new features and deprecations. In the process I also made some minor changes to the CHANGELOGS. The 4_1_release_notes guide is declared WIP.
* | remove duplicate sentence from AS changelog. [ci skip].Yves Senn2013-11-281-2/+1
| |
* | Merge branch 'deprecate_numeric_since_ago' of ↵Jeremy Kemper2013-11-271-0/+17
|\ \ | | | | | | | | | | | | | | | | | | https://github.com/chancancode/rails Conflicts: activesupport/CHANGELOG.md
| * | Deprecated Numeric#{ago,until,since,from_now}Godfrey Chan2013-11-261-0/+17
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The user is expected to explicitly convert the value into an AS::Duration, i.e. `5.ago` => `5.seconds.ago` This will help to catch subtle bugs like: def recent?(days = 3) self.created_at >= days.ago end The above code would check if the model is created within the last 3 **seconds**. In the future, `Numeric#{ago,until,since,from_now}` should be removed completely, or throw some sort of errors to indicate there are no implicit conversion from `Numeric` to `AS::Duration`. Also fixed & refactor the test cases for Numeric#{ago,since} and AS::Duration#{ago,since}. The original test case had the assertion flipped and the purpose of the test wasn't very clear.
* / Requires JSON gem version 1.7.7 or above as it contains an importantGodfrey Chan2013-11-261-0/+4
|/ | | | security fix.
* Add `#travel` and `#travel_to` to AS::TestCasePrem Sichanugrist2013-11-201-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add `ActiveSupport::Testing::TimeHelpers#travel` and `#travel_to`. These methods change current time to the given time or time difference by stubbing `Time.now` and `Date.today` to return the time or date after the difference calculation, or the time or date that got passed into the method respectively. These methods also accept a block, which will return current time back to its original state at the end of the block. Example for `#travel`: Time.now # => 2013-11-09 15:34:49 -05:00 travel 1.day Time.now # => 2013-11-10 15:34:49 -05:00 Date.today # => Sun, 10 Nov 2013 Example for `#travel_to`: Time.now # => 2013-11-09 15:34:49 -05:00 travel_to Time.new(2004, 11, 24, 01, 04, 44) Time.now # => 2004-11-24 01:04:44 -05:00 Date.today # => Wed, 24 Nov 2004 Both of these methods also accept a block, which will return the current time back to its original state at the end of the block: Time.now # => 2013-11-09 15:34:49 -05:00 travel 1.day do User.create.created_at # => Sun, 10 Nov 2013 15:34:49 EST -05:00 end travel_to Time.new(2004, 11, 24, 01, 04, 44) do User.create.created_at # => Wed, 24 Nov 2004 01:04:44 EST -05:00 end Time.now # => 2013-11-09 15:34:49 -05:00 This module is included in `ActiveSupport::TestCase` automatically.
* Unify `cattr_*` interface: allow to pass a block to `cattr_reader`.Alexey Chernenkov2013-11-151-0/+11
| | | | | | | | | Example: class A cattr_reader(:defr) { 'default_reader_value' } end A.defr # => 'default_reader_value'
* Improved compatibility with the stdlib JSON gem.Godfrey Chan2013-11-141-0/+14
| | | | | | | | | | | | Previously, calling `::JSON.{generate,dump}` sometimes causes unexpected failures such as intridea/multi_json#86. `::JSON.{generate,dump}` now bypasses the ActiveSupport JSON encoder completely and yields the same result with or without ActiveSupport. This means that it will **not** call `as_json` and will ignore any options that the JSON gem does not natively understand. To invoke ActiveSupport's JSON encoder instead, use `obj.to_json(options)` or `ActiveSupport::JSON.encode(obj, options)`.
* Improve changelogs formatting [ci skip]Carlos Antonio da Silva2013-11-091-8/+8
|
* Standardize all JSON encoded times to use 3 decimal fractional secondsRyan Glover2013-11-071-0/+5
|
* Do not expose internal state in the public encoder API (i.e. as_json)Godfrey Chan2013-11-061-0/+5
| | | | | | | | | | | | | | | See [1] for why this is not a good idea. As part of this refactor, circular reference protection in as_json has been removed and the corresponding error class has been deprecated. As discussed with @jeremy, circular reference error is considered programmer errors and protecting against it is out of scope for the encoder. This is again based on the excellent work by @sergiocampama in #11728. [1]: https://github.com/intridea/multi_json/pull/138#issuecomment-24468223