aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/CHANGELOG.md
Commit message (Collapse)AuthorAgeFilesLines
...
* | | 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
| |
* | Changelog entry for pr #11474Bogdan Gusiev2013-09-231-0/+5
| |
* | Allow attaching to AS::Notifications namespace up frontDaniel Schierbeck2013-09-201-0/+27
| | | | | | | | | | | | | | | | Before, you were required to attach *after* adding the methods to the class, since the attachment process needed the methods to be present. With this change, any new method will also be attached to the configured namespace.
* | Add CHANGELOG entry for #10879Rafael Mendonça França2013-09-121-0/+6
| | | | | | | | [ci skip]
* | Fix FileStore#cleanup to no longer rely on missing each_key methodMurray Steele2013-09-111-0/+4
|/
* Ensure all-caps nested consts marked as autoloadedSimon Coffey2013-08-271-0/+5
| | | | | | | | | | | | Previously, an autoloaded constant `HTML::SomeClass` would not be marked as autoloaded by AS::Dependencies. This is because the `#loadable_constants_for_path` method uses `String#camelize` on the inferred file path, which in turn means that, unless otherwise directed, AS::Dependencies watches for loaded constants in the `Html` namespace. By passing the original qualified constant name to `#load_or_require`, this inference step is avoided, and the new constant is picked up in the correct namespace.
* Add String#remove(pattern) as a short-hand for the common pattern of ↵David Heinemeier Hansson2013-08-131-0/+4
| | | | String#gsub(pattern, '')
* renames the :abort deprecation behaviour to :raiseXavier Noria2013-08-131-2/+2
| | | | That is a better name, thanks @jeremy.
* fixes typo in CHANGELOGXavier Noria2013-08-131-1/+1
|
* defines a new :abort deprecation behaviour that raisesXavier Noria2013-08-131-0/+12
| | | | See the CHANGELONG message in the patch for further details.
* Add CHANGELOG entry for inflection removalAndrew White2013-07-301-0/+4
|
* Fix handling of offsets with Time#to_s(:iso8601)Andrew White2013-07-291-1/+5
| | | | | | Use a lambda to ensure that the generated string respects the offset of the time value. Also add DateTime#to_s(:iso8601) and Date#to_s(:iso8601) for completeness.
* Add Time#to_s(:iso8601) for easy conversion of times to the iso8601 format ↵David Heinemeier Hansson2013-07-281-0/+4
| | | | for easy Javascript date parsing
* Move #11546 changelog to the top [ci skip]Carlos Antonio da Silva2013-07-221-13/+13
|
* [Fixes #11512] improves cache size calculation in ↵Simeon Simeonov2013-07-221-0/+13
| | | | | | | | | | | | | | | | | | | | | ActiveSupport::Cache::MemoryStore Previously, the cache size of `ActiveSupport::Cache::MemoryStore` was calculated as the sum of the size of its entries, ignoring the size of keys and any data structure overhead. This could lead to the calculated cache size sometimes being 10-100x smaller than the memory used, e.g., in the case of small values. The size of a key/entry pair is now calculated via `#cached_size`: def cached_size(key, entry) key.to_s.bytesize + entry.size + PER_ENTRY_OVERHEAD end The value of `PER_ENTRY_OVERHEAD` is 240 bytes based on an [empirical estimation](https://gist.github.com/ssimeonov/6047200) for 64-bit MRI on 1.9.3 and 2.0. Fixes GH#11512 https://github.com/rails/rails/issues/11512
* Only raise DelegationError if it's is the source of the exceptionAndrew White2013-07-111-0/+6
| | | | | | | | | This fixes situations where nested NoMethodError exceptions are masked by delegations. This would cause confusion especially where there was a problem in the Rails booting process because of a delegation in the routes reloading code. Fixes #10559
* Return local time for backwards compatibilityAndrew White2013-07-091-1/+1
|
* Retain UTC offset when using Time.at_with_coercionAndrew White2013-07-091-0/+6
| | | | | | | | | | The standard Ruby behavior for Time.at is to return the same type of time when passing an instance of Time as a single argument. Since the an ActiveSupport::TimeWithZone instance may be a different timezone than the system timezone and DateTime just understands offsets the best we can do is to return an instance of Time with the correct offset. Fixes #11350.
* Make HashWithIndifferentAccess#select always return the hash.Marc Schütz2013-07-061-0/+5
| | | | | Hash#select! returns nil if the hash didn't change and thus behaves differently from select, so it's return value can't be used as result for the latter.
* Revert "remove string based terminators for `ActiveSupport::Callbacks`."Yves Senn2013-07-051-4/+0
| | | | | | | | This reverts commit d108672dada7ba97d3b3b56f0c6001cea621061e. Conflicts: activesupport/CHANGELOG.md
* fix typo in Active Support CHANGELOG. [ci skip]Yves Senn2013-07-051-1/+1
|
* remove string based terminators for `ActiveSupport::Callbacks`.Yves Senn2013-07-051-0/+4
|
* Remove deprecated `String#encoding_aware?` Arun Agrawal2013-07-031-0/+4
| | | core extensions (`core_ext/string/encoding`).
* Remove deprecated `Module#local_constant_names` Arun Agrawal2013-07-031-0/+4
| | | in favor of `Module#local_constants`
* Remove deprecated `DateTime.local_offset`Arun Agrawal2013-07-031-0/+4
|
* Remove deprecated Logger core extensions (core_ext/logger.rb)Carlos Antonio da Silva2013-07-031-0/+4
|
* Merge pull request #11265 from vipulnsward/deprecated_time_methodsYves Senn2013-07-031-0/+5
|\ | | | | Remove deprecated `Time` methods