aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/CHANGELOG.md
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | 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
* | | Add +capitalize+ option to Inflector.humanizeclaudiob2013-11-061-0/+7
| | | | | | | | | | | | | | | | | | | | | So strings can be humanized without being capitalized: 'employee_salary'.humanize # => "Employee salary" 'employee_salary'.humanize(capitalize: false) # => "employee salary"
* | | Fix AS changelog indent, remove tabs and extra spaces [ci skip]Carlos Antonio da Silva2013-11-061-2/+2
| | |
* | | Fixed Object#as_json and Struct#as_json with optionsGodfrey Chan2013-11-051-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These methods now takes the same options as Hash#as_json, for example: struct = Struct.new(:foo, :bar).new struct.foo = "hello" struct.bar = "world" json = struct.as_json(only: [:foo]) # => {foo: "hello"} This is extracted from PR #11728 from @sergiocampama, see also the discussion in #11460.
* | | Added Numeric#in_milliseconds, like 1.hour.in_milliseconds, so we can feed ↵David Heinemeier Hansson2013-11-021-0/+4
| | | | | | | | | | | | them to JavaScript functions like getTime().
* | | Raise an error when AS::JSON.decode is called with optionsGodfrey Chan2013-10-301-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rails 4.1 has switched away from MultiJson, and does not currently support any options on `ActiveSupport::JSON.decode`. Passing in unsupported options (i.e. any non-empty options hash) will now raise an ArgumentError. Rationale: 1. We cannot guarantee the underlying JSON parser won't change in the future, hence we cannot guarantee a consistent set of options the method could take 2. The `json` gem, which happens to be the current JSON parser, takes many dangerous options that is irrelevant to the purpose of AS's JSON decoding API 3. To reserve the options hash for future use, e.g. overriding default global options like ActiveSupport.parse_json_times This change *DOES NOT* introduce any changes in the public API. The signature of the method is still decode(json_text, options). The difference is this method previously accepted undocumented options which does different things when the underlying adapter changes. It now correctly raises an ArgumentError when it encounters options that it does not recognize (and currently it does not support any options).
* | | Merge pull request #11785 from grosser/grosser/file-unless-existRafael Mendonça França2013-10-281-0/+4
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | support :unless_exist for FileCache Conflicts: activesupport/CHANGELOG.md activesupport/test/caching_test.rb
| * | | support :unless_exist for FileCachegrosser2013-08-301-0/+4
| | |/ | |/|
* | | slice! should not remove default hash value/procAntonio Santos2013-10-241-0/+4
| | |
* | | Fix code blocks identation on AR and AS CHANGELOGsLucas Mazza2013-10-161-6/+6
| | |
* | | Revert "Merge pull request #12480 from iwiznia/master"Jeremy Kemper2013-10-111-7/+0
| | | | | | | | | | | | | | | This reverts commit e5f5a838b96a362534d9bb60d02334439ed9784c, reversing changes made to d7567f3290a50952494e9213556a1f283a6cf3a0.
* | | flatten and flatten! methods for ActiveSupport::DurationIonatan Wiznia2013-10-111-0/+7
| | |
* | | registers 0b0beb7 in the CHANGELOG [ci skip]Xavier Noria2013-10-011-0/+5
| | |