1. 26 6月, 2014 5 次提交
    • S
      Consolidate testing of update_all type casting · 58d38d6d
      Sean Griffin 提交于
      We have several test cases on "tricky" types that are essentially
      testing that `update_all` goes through the same type casting behavior as
      a normal assignment + save. We recently had another case to add this
      test for another type in https://github.com/rails/rails/pull/12742.
      
      Rather than testing this separately for every type which is "tricky"
      when round tripping, let's instead have a fairly exhaustive test that
      ensures we're getting the correct values at every step for `update_all`.
      Given the structure of the code now, we can be confident that if the
      type is correct, and `update_all` is type casting correctly, we're going
      to get the right behavior for all types.
      58d38d6d
    • S
      Deprecate automatic counter caches on has_many :through · d730e374
      Sean Griffin 提交于
      Reliant on https://github.com/rails/rails/pull/15747 but pulled to a
      separate PR to reduce noise. `has_many :through` associations have the
      undocumented behavior of automatically detecting counter caches.
      However, the way in which it does so is inconsistent with counter caches
      everywhere else, and doesn't actually work consistently.
      
      As with normal `has_many` associations, the user should specify the
      counter cache on the `belongs_to`, if they'd like it updated.
      d730e374
    • S
      `Attribute` should know about its name · bb7bc499
      Sean Griffin 提交于
      This allows using polymorphism for the uninitialized attributes raising
      an exception behavior.
      bb7bc499
    • S
      Encapsulate the creation of `Attribute` objects · 14b1208d
      Sean Griffin 提交于
      This will make it less painful to add additional properties, which
      should persist across writes, such as `name`.
      
      Conflicts:
      	activerecord/lib/active_record/attribute_set.rb
      14b1208d
    • Y
      synchronize Active Record deprecations / removals with 4.2 release notes · d708b5cc
      Yves Senn 提交于
      [ci skip]
      
      /cc @chancancode @zzak
      d708b5cc
  2. 25 6月, 2014 2 次提交
    • S
      Move behavior of `read_attribute` to `AttributeSet` · a89f8a92
      Sean Griffin 提交于
      Moved `Builder` to its own file, as it started looking very weird once I
      added private methods to the `AttributeSet` class and the `Builder`
      class started to grow.
      
      Would like to refactor `fetch_value` to change to
      
      ```ruby
      self[name].value(&block)
      ```
      
      But that requires the attributes to know about their name, which they
      currently do not.
      a89f8a92
    • Y
      `preload` preserves readonly flag on associations. #15853 · 5706d290
      Yves Senn 提交于
      This is a partial fix for #15853. It only works when a `preload`
      is issued and not an `eager_load`. I've added a skipped failing
      test-case to keep in mind that we need to deal with `eager_load`.
      5706d290
  3. 24 6月, 2014 8 次提交
  4. 23 6月, 2014 5 次提交
  5. 22 6月, 2014 5 次提交
  6. 21 6月, 2014 1 次提交
  7. 20 6月, 2014 4 次提交
  8. 19 6月, 2014 2 次提交
  9. 18 6月, 2014 8 次提交