1. 05 7月, 2015 3 次提交
  2. 03 7月, 2015 7 次提交
  3. 02 7月, 2015 3 次提交
  4. 01 7月, 2015 5 次提交
    • R
      [ci skip] Improve the url_for documentation · 48dc8261
      Roque Pinel 提交于
      Clarify the `url_for` usage in mailers.
      
      Re-add the documentation about `url_for` and Route's path parameters,
      first introduced by 5c4f1859.
      This was reported on #15097 and until it is decided to deprecate it
      or not, I believe the documentation should exist.
      48dc8261
    • R
      Separate the constraint and other options [ci skip] · bc71e432
      Robin Dupret 提交于
      Only one constraint option can be used at a time (except for the minimum
      and maximum ones that can eventually be combined). However, other
      options can be used with them (e.g. the validation failure message).
      So let's make the distinction between these two different options
      categories.
      
      [Yves Senn, Matthew Draper & Robin Dupret]
      bc71e432
    • K
      Merge pull request #20747 from pwnall/fix_minitest_rails · 1099e54b
      Kasper Timm Hansen 提交于
      Avoid crashing when minitest-rails is loaded.
      1099e54b
    • V
      Avoid crashing when minitest-rails is loaded. · e334ec4f
      Victor Costan 提交于
      The improvments to the test runner's integration with minitest in commit
      b6fc8e25 add methods to the Minitest
      module that refer to the Rails module. Unfortunately, when the
      minitest-rails gem is loaded, the reference is incorrectly resolved to
      the Minitest::Rails module.
      e334ec4f
    • S
      Correct through associations using scopes · bc6ac860
      Sean Griffin 提交于
      The changes introduced to through associations in c80487eb were quite
      interesting. Changing `relation.merge!(scope)` to `relation =
      relation.merge(scope)` should in theory never cause any changes in
      behavior. The subtle breakage led to a surprising conclusion.
      
      The old code wasn't doing anything! Since `merge!` calls
      `instance_exec` when given a proc, and most scopes will look something
      like `has_many :foos, -> { where(foo: :bar) }`, if we're not capturing
      the return value, it's a no-op. However, removing the `merge` causes
      `unscope` to break.
      
      While we're merging in the rest of the chain elsewhere, we were never
      merging in `unscope` values, causing a breakage on associations where a
      default scope was being unscoped in an association scope (yuk!). This is
      subtly related to #20722, since it appears we were previously relying on
      this mutability.
      
      Fixes #20721.
      Fixes #20727.
      bc6ac860
  5. 30 6月, 2015 11 次提交
  6. 29 6月, 2015 7 次提交
  7. 28 6月, 2015 4 次提交
    • Y
      [ci skip] Fix action_controller_overview · d9212f64
      yui-knk 提交于
      d9212f64
    • X
      updates a migration example in the Getting Started guide [ci skip] · fd495a8d
      Xavier Noria 提交于
      Closes #20705.
      fd495a8d
    • Y
    • S
      Revert the behavior of association names and `where` to be closer to 4.2 · 6a6c4c45
      Sean Griffin 提交于
      With this change, we will always assume the association name is the same
      as the table it's referencing. This is subtly different than treating
      the hash key passed to `where` as the table name, as it still allows the
      class referenced by the association to provide additional type
      information.
      
      After exploring several possible solutions to the ambiguity problem, I
      do not think there is a short term answer that will maintain backwards
      compatibility.
      
      This change will make it so the following code does not work:
      
          class User
            has_many :approved_posts, -> { where(approved: true) }, class_name: "Post"
          end
      
          User.where(approved_posts: { id: 1 })
      
      But prevents potential ambiguity and collision as demonstrated in [this
      gist](https://gist.github.com/senny/1ae4d8ea7b0e269ed7a0).
      
      Unfortunately, truely solving this requires significantly
      re-architecting this code, so that what is currently represented as an
      `Arel::Attribute` is instead another data structure that also references
      the association it is representing, so we can identify the proper table
      name for aliasing when we construct the final tree.
      
      While I'd still like to accomplish that in the long run, I don't think
      I'll be able to get there in time for Rails 5 (since I'm not full time
      OSS any more, and this is several weeks worth of work). I'm hoping to
      achieve this for Rails 5.1.
      
      Fixes #20308
      6a6c4c45