aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/CHANGELOG.md
Commit message (Collapse)AuthorAgeFilesLines
* Refactor AS::Callbacks halt config and fix the documentationRoque Pinel2015-10-011-6/+3
| | | | | | | | | Move from `AS::Callbacks::CallbackChain.halt_and_display_warning_on_return_false` to `AS::Callbacks.halt_and_display_warning_on_return_false` base on [this discussion](https://github.com/rails/rails/pull/21218#discussion_r39354580) Fix the documentation broken by 0a120a818d413c64ff9867125f0b03788fc306f8
* Make `assert_difference` return the result of the yielded block.Lucas Mazza2015-09-241-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | With this we can perform new assertions on the returned value without having to cache it with an outer variable or wrapping all subsequent assertions inside the `assert_difference` block. Before: ``` post = nil assert_difference -> { Post.count }, 1 do Post.create end assert_predicate post, :persisted? ``` Now: ``` post = assert_difference -> { Post.count } do Post.create end assert_predicate post, :persisted? ```
* Fix the AS::Callbacks terminator regression from 4.2.3Roque Pinel2015-09-221-9/+6
| | | | | | Rails 4.2.3 AS::Callbacks will not halt chain if `false` is returned. That is the behavior of specific callbacks like AR::Callbacks and AM::Callbacks.
* Short-circuit `blank?` on date and time valuesAndrew White2015-09-211-0/+6
| | | | | | | The concept of a blank date or time doesn't make sense so we can short circuit the calls for `blank?` on these classes to gain small speed boost. Fixes #21657
* Replaced `ThreadSafe::Map` with successor `Concurrent::Map`.Jerry D'Antonio2015-09-191-0/+5
| | | | | | | The thread_safe gem is being deprecated and all its code has been merged into the concurrent-ruby gem. The new class, Concurrent::Map, is exactly the same as its predecessor except for fixes to two bugs discovered during the merge.
* Update Unicode Version to 8.0.0Anshul Sharma2015-09-041-0/+4
|
* No need CHANGELOG entry for #21421 [ci skip]Rafael Mendonça França2015-09-011-6/+0
|
* ArrayInquirer to correctly find symbols or stringsLeigh Halliday2015-08-281-8/+14
| | | | | | | | | The problem existed where if your ArrayInquirer values were strings but you checked them using any? with a symbol, it would not find the value. Now it will correctly check whether both the String form or the Symbol form are included in the Array. `
* - Extracted `DELIMITED_REGEX` to `delimited_regex` method and made use of ↵Vipul A M2015-08-281-0/+10
| | | | | | | | | | user passed `options[:delimited_regex]` if available. Changed `DELIMITED_REGEX` to `DEFAULT)DELIMITED_REGEX` to signify what it means. - Added tests for number to delimited and number to currency in both actionview and activesupport. Changes Changes
* Deprecate :si prefix in number_to_human_size without replacementJean Boussier2015-08-101-0/+4
|
* Fix `TimeWithZone#eql?` to handle `TimeWithZone` created from `DateTime`Roque Pinel2015-07-191-0/+8
| | | | | | | | | | | | | | | | | | | | Before: ```ruby twz = DateTime.now.in_time_zone twz.eql?(twz.dup) => false ``` Now: ```ruby twz = DateTime.now.in_time_zone twz.eql?(twz.dup) => true ``` Please notice that this fix the `TimeWithZone` comparison to itself, not to `DateTime`. Based on #3725, `DateTime` should not be equal to `TimeWithZone`.
* ActiveSupport::HashWithIndifferentAccess select and reject should return ↵Bernard Potocki2015-07-171-0/+7
| | | | enumerator if called without block
* Replaced `ActiveSupport::Concurrency::Latch` with concurrent-ruby.Jerry D'Antonio2015-07-131-0/+5
| | | | | | | | | | The concurrent-ruby gem is a toolset containing many concurrency utilities. Many of these utilities include runtime-specific optimizations when possible. Rather than clutter the Rails codebase with concurrency utilities separate from the core task, such tools can be superseded by similar tools in the more specialized gem. This commit replaces `ActiveSupport::Concurrency::Latch` with `Concurrent::CountDownLatch`, which is functionally equivalent.
* fix class name typo [ci skip]yuuji.yaginuma2015-07-111-1/+1
|
* active_support/indifferent_hash: dont raise on to_hash when default_proc raisesSimon Eskildsen2015-07-101-0/+5
|
* active_support/indifferent_hash: fix cloning default_proc on dupSimon Eskildsen2015-07-101-0/+4
|
* Code fix in CHANGELOGAditya Sanghi2015-06-081-1/+1
| | | :nail: remove extraneous bracket
* Fix a range of values for parameters of the Time#changeNikolay Kondratyev2015-06-011-0/+4
| | | | | Passing 999999000 < `:nsec` < 999999999 and 999999 < `:usec` < 1000000 to change a time with utc_offset doesn't throw an `ArgumentError`.
* Add Enumerable#pluck.Kevin Deisz2015-05-281-0/+7
| | | | Allows fetching the same values from arrays as from ActiveRecord associations.
* Merge pull request #20208 from gaurish/raise_on_missing_ordered_optionsRafael Mendonça França2015-05-261-0/+17
|\ | | | | | | Add bang version to OrderedOptions
| * Add bang version to OrderedOptionsGaurish Sharma2015-05-231-0/+15
| | | | | | | | | | | | By: Aditya Sanghi(@asanghi) Gaurish Sharma(gaurish)
* | Merge pull request #16938 from akshay-vishnoi/remove-depricationYves Senn2015-05-261-0/+5
|\ \ | |/ |/| | | Remove `.superclass_delegating_accessor`.
| * Remove `.superclass_delegating_accessor`. Refer #14271Akshay Vishnoi2015-05-241-0/+4
|/
* add missing punctuation in changelog. [ci skip]Yves Senn2015-05-201-2/+2
|
* Patch `Delegator` to work with `#try`Nate Smith2015-05-191-0/+6
| | | | | | | | | | | | `Delegator` inherits from `BasicObject`, which means that it will not have `Object#try` defined. It will then delegate the call to the underlying object, which will not (necessarily) respond to the method defined in the enclosing `Delegator`. This patches `Delegator` with the `#try` method to work around the surprising behaviour. Fixes #5790
* Fix typos is CHANGELOG [ci skip]karanarora2015-05-191-8/+8
|
* Pass over CHANGELOGS [ci skip]Prathamesh Sonpatki2015-05-161-3/+5
|
* Add Integer#positive? and Integer#negative? query methods in the vein of ↵David Heinemeier Hansson2015-05-131-0/+5
| | | | Fixnum#zero?
* Improve ActiveSupport::TimeWithZone conversion to YAMLAndrew White2015-04-221-0/+6
| | | | | | | | | | | Previously when converting AS::TimeWithZone to YAML it would be output as a UTC timestamp. Whilst this preserves the time information accurately it loses the timezone information. This commit changes that so that it is saved along with the time information. It also provides nicer encoding of AS::TimeZone instances themselves which previously embedded all of the data from the TZInfo records. Fixes #9183.
* Add ActiveSupport::TimeZone#strptime.Paul A Jungwirth2015-04-221-0/+5
| | | | This makes it easier to parse user-inputted times as from a given time zone.
* pass over CHANGELOGs. [ci skip]Yves Senn2015-04-221-1/+2
|
* Raise ArgumentError if an unrecognised callback is skippedIain Beeston2015-04-031-0/+5
| | | | | | | | | | | | | | At present, if you skip a callback that hasn't been defined, activesupport callbacks silently does nothing. However, it's easy to mistype the name of a callback and mistakenly think that it's being skipped, when it is not. This problem even exists in the current test suite. CallbacksTest::SkipCallbacksTest#test_skip_person attempts to skip callbacks that were never set up. This PR changes `skip_callback` to raise an `ArgumentError` if the specified callback cannot be found.
* Revert "Remove Array#inquiry"Rafael Mendonça França2015-03-301-1/+4
| | | | | | This reverts commit 9420de59f5b7f5ceac77e28e6c326ec145f71f80. Reason: Turns out we want to keep this method.
* Remove Array#inquiryRafael Mendonça França2015-03-271-4/+1
| | | | | We are promoting too much a feature that will not be widler used. So for now lets keep just the ArrayInquirer constructor.
* Add ActiveSupport::ArrayInquirer and Array#inquiryGeorge Claghorn2015-03-241-0/+20
| | | | | | | | | | | | | | | | | | | | | | Wrapping an array in an `ArrayInquirer` gives a friendlier way to check its string-like contents. For example, `request.variant` returns an `ArrayInquirer` object. To check a request's variants, you can call: request.variant.phone? request.variant.any?(:phone, :tablet) ...instead of: request.variant.include?(:phone) request.variant.any? { |v| v.in?([:phone, :tablet]) } `Array#inquiry` is a shortcut for wrapping the receiving array in an `ArrayInquirer`: pets = [:cat, :dog] pets.cat? # => true pets.ferret? # => false pets.any?(:cat, :ferret} # => true
* Deprecate alias_method_chain in favour of Module#prependKir Shatrov2015-03-221-0/+4
| | | …as discussed #19413
* Revert "Take DST into account when locating TimeZone from Numeric."Andrew White2015-03-091-10/+0
| | | | | | | | | | | | | | | | Reverting this as it's not the implementation that we would like it to be. This is being used inside of ActiveSUpport::TimeZone[] and it's unaware of the context in which to find the timezone period so the timezone found changes depending on whether DST is in effect for the current period. This means that `'2001-01-01'.in_time_zone(-9)` changes from winter/summer even though it's the same date that we're trying to convert. Since finding timezones by numeric offsets is a bit hit and miss we should introduce a new API for finding them which supplies the date context in which we want to search and we should probably also deprecate the finding of timezones via the [] method, though this needs further discussion. This reverts commit 2cc2fa3633edd96773023c6b09d07c7b9d9b841d.
* Remove a duplicated changelog entry [ci skip]Robin Dupret2015-03-061-7/+0
| | | | This entry now lives in the Action View's changelog ; refs 8a3bd089.
* `number_to_percentage` and `precision: 0` work with `NAN` and `INFINITY`.Yves Senn2015-03-061-0/+7
| | | | Closes #19227.
* Take DST into account when locating TimeZone from Numeric.Yasyf Mohamedali2015-03-031-0/+10
| | | | | | When given a specific offset, use the first result found where the total current offset (including any periodic deviations such as DST) from UTC is equal.
* Add Enumerable#withoutTodd Bealmear2015-03-011-0/+5
|
* Fix a backtracking problem in String#truncate_wordsHenrik Nygren2015-02-251-0/+5
| | | | Fixes #19070.
* some indenting and punctuation fixes. [ci skip]Yves Senn2015-02-231-13/+14
|
* Properly dump primitive-like AS::SafeBuffer strings as YAMLGodfrey Chan2015-02-111-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `coder.represent_scalar` means something along the lines of "Here is a quoted string, you can just add it to the output", which is not the case here. It only works for simple strings that can appear unquoted in YAML, but causes problems for e.g. primitive-like strings ("1", "true"). `coder.represent_object` on the other hand, means that "This is the Ruby-object representation for this thing suitable for use in YAML dumping", which is what we want here. Before: YAML.load ActiveSupport::SafeBuffer.new("Hello").to_yaml # => "Hello" YAML.load ActiveSupport::SafeBuffer.new("true").to_yaml # => true YAML.load ActiveSupport::SafeBuffer.new("false").to_yaml # => false YAML.load ActiveSupport::SafeBuffer.new("1").to_yaml # => 1 YAML.load ActiveSupport::SafeBuffer.new("1.1").to_yaml # => 1.1 After: YAML.load ActiveSupport::SafeBuffer.new("Hello").to_yaml # => "Hello" YAML.load ActiveSupport::SafeBuffer.new("true").to_yaml # => "true" YAML.load ActiveSupport::SafeBuffer.new("false").to_yaml # => "false" YAML.load ActiveSupport::SafeBuffer.new("1").to_yaml # => "1" YAML.load ActiveSupport::SafeBuffer.new("1.1").to_yaml # => "1.1" If we ever want Ruby to behave more like PHP or JavaScript though, this is an excellent trick to use ;)
* Merge pull request #12067 from jackxxu/keep_precisionRafael Mendonça França2015-02-061-0/+4
|\ | | | | | | | | | | | | | | | | Enable number_to_percentage to keep the number's precision by allowing :precision option value to be nil Conflicts: activesupport/CHANGELOG.md activesupport/lib/active_support/number_helper.rb activesupport/test/number_helper_test.rb
| * Enable number_to_percentage to keep the number's precision by allowing ↵Jack Xu2013-08-281-0/+5
| | | | | | | | | | | | :precision to be nil number_helper.number_to_percentage(1000, precision: nil) # => "1000%"
* | Privatize config_accessor as with attr_accessorAkira Matsuda2015-02-061-0/+4
| |
* | Change AS::Testing::TimeHelpers#travel_to to also stub DateTime.nowYuki Nishijima2015-02-031-0/+5
| |
* | introduce `ActiveSupport::Testing::FileFixtures`.Yves Senn2015-01-281-0/+8
| | | | | | | | | | | | It's a thin layer to provide easy access to sample files throughout test-cases. This adds the directory `test/fixtures/files` to newly generated applications.
* | Merge pull request #18709 from ianks/atomic-writeYves Senn2015-01-281-0/+4
| | | | | | | | Return value of yielded block in File.atomic_write