1. 04 1月, 2015 1 次提交
  2. 03 1月, 2015 4 次提交
    • C
      Add config to halt callback chain on return false · 9c65c539
      claudiob 提交于
      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
      9c65c539
    • C
      Deprecate `false` as the way to halt AS callbacks · d217daf6
      claudiob 提交于
      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.
      d217daf6
    • C
      Throw :abort halts default CallbackChains · 2386daab
      claudiob 提交于
      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`.
      2386daab
    • R
      Deprecate `MissingSourceFile` in favor of `LoadError`. · 734d97d2
      Rafael Mendonça França 提交于
      `MissingSourceFile` was just an alias to `LoadError` and was not
      being raised inside the framework.
      734d97d2
  3. 01 1月, 2015 1 次提交
  4. 23 12月, 2014 1 次提交
  5. 10 12月, 2014 1 次提交
  6. 05 12月, 2014 1 次提交
  7. 02 12月, 2014 1 次提交
    • L
      Add `#verified` and `#valid_message?` to MessageVerifier · 7ad541f9
      Logan Leger 提交于
      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.
      7ad541f9
  8. 29 11月, 2014 1 次提交
  9. 11 11月, 2014 1 次提交
  10. 06 11月, 2014 1 次提交
  11. 28 10月, 2014 1 次提交
  12. 26 10月, 2014 1 次提交
  13. 23 10月, 2014 1 次提交
  14. 16 10月, 2014 1 次提交
  15. 30 9月, 2014 1 次提交
  16. 19 9月, 2014 1 次提交
  17. 18 9月, 2014 2 次提交
  18. 14 9月, 2014 1 次提交
  19. 12 9月, 2014 1 次提交
  20. 08 9月, 2014 1 次提交
    • G
      Default to sorting user's test cases for now · 2b41343c
      Godfrey Chan 提交于
      Goals:
      
      1. Default to :random for newly generated applications
      2. Default to :sorted for existing applications with a warning
      3. Only show the warning once
      4. Only show the warning if the app actually uses AS::TestCase
      
      Fixes #16769
      2b41343c
  21. 06 9月, 2014 1 次提交
  22. 05 9月, 2014 1 次提交
  23. 04 9月, 2014 1 次提交
  24. 02 9月, 2014 1 次提交
  25. 30 8月, 2014 4 次提交
  26. 25 8月, 2014 1 次提交
    • R
      Follow-up to #16560 · d5578cd1
      Robin Dupret 提交于
      For the sake of backward-compatibility, we need to make #instance_of?
      return true for Fixnum. On the other hand, the method should still
      give true for ActiveSupport::Duration itself which was not the case
      before.
      d5578cd1
  27. 18 8月, 2014 2 次提交
    • R
      Define the Duration#instance_of? method · eb73d7da
      Robin Dupret 提交于
      Since Duration is extending from ProxyObject which extends itself from
      BasicObject, the Duration object doesn't respond to the #instance_of?
      method. Thus, the #method_missing hook get triggered, delegating the
      method to its `value` attribute.
      
      However, Rubinius' #eql? definition relies on #instance_of?, thus this
      will equal to true with a Fixnum (since its `value` attribute is a
      Fixnum) while it should not.
      
      The previous behavior was wrong anyway, no matter the implementation.
      eb73d7da
    • D
      Fix rounding errors with #travel_to by resetting the usec on any passed time... · 9f6e82ee
      David Heinemeier Hansson 提交于
      Fix rounding errors with #travel_to by resetting the usec on any passed time to zero, so we only travel with per-second precision, not anything deeper than that.
      9f6e82ee
  28. 12 8月, 2014 2 次提交
  29. 07 8月, 2014 1 次提交
  30. 05 8月, 2014 1 次提交
  31. 02 8月, 2014 1 次提交