1. 18 6月, 2014 1 次提交
    • S
      Don't save through records twice · 068f092c
      Sean Griffin 提交于
      If the through record gets created in an `after_create` hook that is
      defined before the association is defined (therefore after its
      `after_create` hook) get saved twice. This ensures that the through
      records are created only once, regardless of the order of the hooks.
      068f092c
  2. 14 6月, 2014 1 次提交
  3. 29 4月, 2014 1 次提交
  4. 23 4月, 2014 2 次提交
  5. 03 4月, 2014 1 次提交
  6. 20 2月, 2014 1 次提交
  7. 17 11月, 2013 1 次提交
  8. 12 11月, 2013 1 次提交
  9. 28 10月, 2013 2 次提交
  10. 09 10月, 2013 1 次提交
  11. 28 9月, 2013 1 次提交
  12. 25 9月, 2013 1 次提交
  13. 24 9月, 2013 3 次提交
  14. 12 9月, 2013 1 次提交
  15. 07 9月, 2013 1 次提交
  16. 04 9月, 2013 1 次提交
  17. 31 8月, 2013 1 次提交
  18. 30 8月, 2013 2 次提交
  19. 18 8月, 2013 1 次提交
  20. 03 8月, 2013 1 次提交
  21. 26 7月, 2013 1 次提交
  22. 09 7月, 2013 1 次提交
  23. 30 6月, 2013 1 次提交
    • N
      Do not invoke callbacks when delete_all is called · f319e4a9
      Neeraj Singh 提交于
      Method `delete_all` should not be invoking callbacks and this
      feature was deprecated in Rails 4.0. This is being removed.
      `delete_all` will continue to honor the `:dependent` option. However
      if `:dependent` value is `:destroy` then the default deletion
      strategy for that collection will be applied.
      
      User can also force a deletion strategy by passing parameter to
      `delete_all`. For example you can do `@post.comments.delete_all(:nullify)`
      f319e4a9
  24. 05 4月, 2013 1 次提交
  25. 28 1月, 2013 1 次提交
    • J
      Prevent Relation#merge from collapsing wheres on the RHS · c8d88990
      Jon Leighton 提交于
      This caused a bug with the new associations implementation, because now
      association conditions are represented as Arel nodes internally right up
      to when the whole thing gets turned to SQL.
      
      In Rails 3.2, association conditions get turned to raw SQL early on,
      which prevents Relation#merge from interfering.
      
      The current implementation was buggy when a default_scope existed on the
      target model, since we would basically end up doing:
      
        default_scope.merge(association_scope)
      
      If default_scope contained a where(foo: 'a') and association_scope
      contained a where(foo: 'b').where(foo: 'c') then the merger would see
      that the same column is representated on both sides of the merge and
      collapse the wheres to all but the last: where(foo: 'c')
      
      Now, the RHS of the merge is left alone.
      
      Fixes #8990
      c8d88990
  26. 18 1月, 2013 2 次提交
  27. 04 1月, 2013 1 次提交
  28. 15 12月, 2012 1 次提交
  29. 12 11月, 2012 1 次提交
  30. 10 10月, 2012 1 次提交
  31. 05 10月, 2012 2 次提交
  32. 04 10月, 2012 1 次提交
    • F
      Count returns 0 without querying if parent is not saved · aa202adf
      Francesco Rodriguez 提交于
      Patches `CollectionAssociation#count` to return 0 without querying
      if the parent record is new. Consider the following code:
      
          class Account
            has_many :dossiers
          end
      
          class Dossier
            belongs_to :account
          end
      
          a = Account.new
          a.dossiers.build
      
          # before patch
          a.dossiers.count
          # SELECT COUNT(*) FROM "dossiers" WHERE "dossiers"."account_id" IS NULL
          # => 0
      
          # after
          a.dosiers.count # fires without sql query
          # => 0
      
      Fixes #1856.
      aa202adf
  33. 17 9月, 2012 1 次提交