aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/CHANGELOG.md
Commit message (Collapse)AuthorAgeFilesLines
* 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
* | Fix assignment for frozen value in HWIAAditya Kapoor2015-01-171-0/+7
| |
* | Add missing time zone definitions for Russian FederationAndrey Novikov2015-01-131-0/+5
| | | | | | | | Also sync Russian Federation time zones with `zone.tab` file from tzdata version 2014j.
* | formatting pass over CHANGELOGs. [ci skip]Yves Senn2015-01-101-1/+3
| |
* | Add SecureRandom.base58Guillermo Iguaran2015-01-091-0/+4
| |
* | Add #prev_day and #next_day as counterparts to #yesterday and #tomorrow for ↵George Claghorn2015-01-061-0/+5
| | | | | | | | Date, Time, and DateTime
* | Add same_time option to #prev_week and #next_week for Date, Time, and DateTimeGeorge Claghorn2015-01-061-0/+5
| |
* | Add #on_weekend?, #next_weekday, and #prev_weekday methods to Date, Time, ↵George Claghorn2015-01-061-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | and DateTime `#on_weekend?` returns true if the receiving date/time falls on a Saturday or Sunday. `#next_weekday` returns a new date/time representing the next day that does not fall on a Saturday or Sunday. `#prev_weekday` returns a new date/time representing the previous day that does not fall on a Saturday or Sunday.
* | Change the default test order from `:sorted` to `:random`Rafael Mendonça França2015-01-041-0/+4
| |
* | Remove deprecated ActiveSupport::JSON::Encoding::CircularReferenceError.Rafael Mendonça França2015-01-041-0/+4
| |
* | Remove deprecated ActiveSupport::JSON::Encoding.encode_big_decimal_as_string=Rafael Mendonça França2015-01-041-0/+5
| |
* | Remove deprecated `ActiveSupport::SafeBuffer#prepend`Rafael Mendonça França2015-01-041-0/+4
| |
* | Remove deprecated methods at `Kernel`.Rafael Mendonça França2015-01-041-0/+6
| | | | | | | | `silence_stderr`, `silence_stream`, `capture` and `quietly`.
* | Remove deprecated core_ext/big_decimal/yaml_conversions fileRafael Mendonça França2015-01-041-0/+5
| |
* | Remove deprecated ActiveSupport::Cache::Store.instrumentRafael Mendonça França2015-01-041-1/+5
| |
* | Add config to halt callback chain on return falseclaudiob2015-01-021-6/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This stems from [a comment](rails#17227 (comment)) by @dhh. In summary: * New Rails 5.0 apps will not accept `return false` as a way to halt callback chains, and will not display a deprecation warning. * Existing apps ported to Rails 5.0 will still accept `return false` as a way to halt callback chains, albeit with a deprecation warning. For this purpose, this commit introduces a Rails configuration option: ```ruby config.active_support.halt_callback_chains_on_return_false ``` For new Rails 5.0 apps, this option will be set to `false` by a new initializer `config/initializers/callback_terminator.rb`: ```ruby Rails.application.config.active_support.halt_callback_chains_on_return_false = false ``` For existing apps ported to Rails 5.0, the initializers above will not exist. Even running `rake rails:update` will not create this initializer. Since the default value of `halt_callback_chains_on_return_false` is set to `true`, these apps will still accept `return true` as a way to halt callback chains, displaying a deprecation warning. Developers will be able to switch to the new behavior (and stop the warning) by manually adding the line above to their `config/application.rb`. A gist with the suggested release notes to add to Rails 5.0 after this commit is available at https://gist.github.com/claudiob/614c59409fb7d11f2931
* | Deprecate `false` as the way to halt AS callbacksclaudiob2015-01-021-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | After this commit, returning `false` in a callback will display a deprecation warning to make developers aware of the fact that they need to explicitly `throw(:abort)` if their intention is to halt a callback chain. This commit also patches two internal uses of AS::Callbacks (inside ActiveRecord and ActionDispatch) which sometimes return `false` but whose returned value is not meaningful for the purpose of execution. In both cases, the returned value is set to `true`, which does not affect the execution of the callbacks but prevents unrequested deprecation warnings from showing up.
* | Throw :abort halts default CallbackChainsclaudiob2015-01-021-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit changes arguments and default value of CallbackChain's :terminator option. After this commit, Chains of callbacks defined **without** an explicit `:terminator` option will be halted as soon as a `before_` callback throws `:abort`. Chains of callbacks defined **with** a `:terminator` option will maintain their existing behavior of halting as soon as a `before_` callback matches the terminator's expectation. For instance, ActiveModel's callbacks will still halt the chain when a `before_` callback returns `false`.
* | Deprecate `MissingSourceFile` in favor of `LoadError`.Rafael Mendonça França2015-01-021-0/+7
| | | | | | | | | | `MissingSourceFile` was just an alias to `LoadError` and was not being raised inside the framework.
* | Changelog edits [ci skip]Robin Dupret2014-12-311-4/+10
| |
* | cleanup CHANGELOGs. [ci skip]Yves Senn2014-12-231-1/+1
| |
* | Add class level case operator support for error dispatching in RescuableGenadi Samokovarov2014-12-101-0/+16
| |
* | Fix MessageVerifier's #verified in CHANGELOGclaudiob2014-12-041-4/+4
| | | | | | | | | | | | | | | | [ci skip] As confirmed by @lleger (the author of `verified`) [in this comment](https://github.com/rails/rails/pull/17727#issuecomment-65488743): > Actually, it no longer returns false explicitly (bc8cc56), so I guess the CHANGELOG isn't totally accurate. It returns nil instead (but the functionality isn't practically different).
* | Add `#verified` and `#valid_message?` to MessageVerifierLogan Leger2014-12-011-0/+8
| | | | | | | | | | | | | | | | | | | | | | This commit adds a `#verified` method to `ActiveSupport::MessageVerifier` which will return either `false` when it encounters an error or the message. `#verify` continues to raise an `InvalidSignature` exception on error. This commit also adds a convenience boolean method on `MessageVerifier` as a way to check if a message is valid without performing the decoding.
* | Start Rails 5 development :tada:Rafael Mendonça França2014-11-281-388/+1
| | | | | | | | | | | | | | We will support only Ruby >= 2.1. But right now we don't accept pull requests with syntax changes to drop support to Ruby 1.9.
* | dependencies.rb: keep the decorated #load and #require private [closes #17553]Xavier Noria2014-11-101-0/+6
| |
* | docs, synchronize 4.2. release notes. [ci skip]Yves Senn2014-11-061-3/+3
| | | | | | | | /cc @chancancode
* | Merge pull request #17383 from rwz/string-removeRafael Mendonça França2014-11-031-0/+4
|\ \ | | | | | | | | | | | | | | | | | | Make `String#remove` and `String#remove!` accept multiple arguments Conflicts: activesupport/CHANGELOG.md
| * | Make `String#remove` and `String#remove!` accept multiple argumentsPavel Pravosud2014-10-251-0/+4
| | |