1. 04 1月, 2015 22 次提交
  2. 03 1月, 2015 18 次提交
    • R
      Fix a few typos [ci skip] · 9b9ec0de
      Robin Dupret 提交于
      9b9ec0de
    • V
      Merge branch 'master' of github.com:rails/docrails · 4b9dba99
      Vijay Dev 提交于
      4b9dba99
    • X
      Merge pull request #18310 from robin850/guides-improvements · 02e72a49
      Xavier Noria 提交于
      Some guides improvements
      02e72a49
    • R
      Avoid displaying new lines inside note paragraphs · d0703280
      Robin Dupret 提交于
      Commit 65a2977c added a `pre-wrap` style for white spaces on `.note`
      paragraphs. However, this is first inconsistent as other notes like
      warnings don't have this style applied. Furthermore, it seems to be
      unneeded for mobile devices.
      
      Also revert changes made in #18147 since they aren't needed anymore.
      
      Cross-refs #18138.
      
      [ci skip]
      d0703280
    • R
      Consider `html+erb` as a valid language for snippets · 0aa18c7d
      Robin Dupret 提交于
      To highlight ERB snippets, both `erb` and `html+erb` are used as a
      language passed to the code block. However, only the former will be
      correctly highlighted.
      0aa18c7d
    • R
      Update Redcarpet to version 3.2.2 · ece28185
      Robin Dupret 提交于
      ece28185
    • R
      Merge pull request #18309 from PaBLoX-CL/fix-fixtures-references · a699f5d3
      Rafael Mendonça França 提交于
      Generated fixtures won't use parent_id when generated with
      parent:references
      a699f5d3
    • P
    • R
      Merge pull request #10380 from JonRowe/test_all_domain_2_letter_tld · 3456d543
      Rafael Mendonça França 提交于
      Assert that 2 letter tlds with 3 letter domain names work when option specified.
      3456d543
    • R
      Merge pull request #18307 from brainopia/datetime_regression · 540a8185
      Rafael Mendonça França 提交于
      Fully support datetime values in AR::Type::DateTime#type_cast_for_database
      540a8185
    • R
      Merge pull request #18308 from jcoyne/i18n_translate_safety · 41740be7
      Rafael Mendonça França 提交于
      Unsafe default translations should not be marked html_safe
      41740be7
    • 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 AR callbacks · bb78af73
      claudiob 提交于
      Before this commit, returning `false` in an ActiveRecord `before_` callback
      such as `before_create` would halt the callback chain.
      
      After this commit, the behavior is deprecated: will still work until
      the next release of Rails but will also display a deprecation warning.
      
      The preferred way to halt a callback chain is to explicitly `throw(:abort)`.
      bb78af73
    • C
      Deprecate `false` as the way to halt AM callbacks · 91b81293
      claudiob 提交于
      Before this commit, returning `false` in an ActiveModel `before_` callback
      such as `before_create` would halt the callback chain.
      
      After this commit, the behavior is deprecated: will still work until
      the next release of Rails but will also display a deprecation warning.
      
      The preferred way to halt a callback chain is to explicitly `throw(:abort)`.
      91b81293
    • C
      Deprecate `false` as the way to halt AM validation callbacks · f7679812
      claudiob 提交于
      Before this commit, returning `false` in an ActiveModel validation
      callback such as `before_validation` would halt the callback chain.
      
      After this commit, the behavior is deprecated: will still work until
      the next release of Rails but will also display a deprecation warning.
      
      The preferred way to halt a callback chain is to explicitly `throw(:abort)`.
      f7679812
    • 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
    • C
      Loosen test about order of initializers · 93dd5028
      claudiob 提交于
      This commit modifies the code (but not the purpose) of a test that checks that
      
      > initializers are executed after application configuration initializers
      
      Currently the test hard-codes the *exact* initializers that are expected to
      occur before a custom one. This can cause the test to fail even if the
      expectation still passes.
      
      This commit loosens the test by simply checking that, in the array of
      initializers, the custom initializers (called `dummy_initializer` in the
      example) is executed after the last occurrence of `load_config_initializers`.
      93dd5028