1. 07 3月, 2015 1 次提交
  2. 28 2月, 2015 1 次提交
  3. 21 2月, 2015 1 次提交
  4. 02 1月, 2015 1 次提交
  5. 30 12月, 2014 1 次提交
  6. 27 12月, 2014 1 次提交
    • S
      Inject the `PredicateBuilder` into the `Relation` instance · 1d6bb776
      Sean Griffin 提交于
      Construction of relations can be a hotspot, we don't want to create one
      of these in the constructor. This also allows us to do more expensive
      things in the predicate builder's constructor, since it's created once
      per AR::Base subclass
      1d6bb776
  7. 04 10月, 2014 1 次提交
  8. 27 8月, 2014 4 次提交
  9. 07 4月, 2014 1 次提交
  10. 03 4月, 2014 1 次提交
  11. 22 1月, 2014 4 次提交
  12. 04 1月, 2014 1 次提交
  13. 11 12月, 2013 2 次提交
  14. 12 11月, 2013 1 次提交
  15. 24 10月, 2013 1 次提交
  16. 13 10月, 2013 1 次提交
  17. 22 8月, 2013 1 次提交
  18. 02 7月, 2013 1 次提交
  19. 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
  20. 28 6月, 2013 1 次提交
    • J
      Simplify/fix implementation of default scopes · 94924dc3
      Jon Leighton 提交于
      The previous implementation was necessary in order to support stuff
      like:
      
          class Post < ActiveRecord::Base
            default_scope where(published: true)
            scope :ordered, order("created_at")
          end
      
      If we didn't evaluate the default scope at the last possible moment
      before sending the SQL to the database, it would become impossible to
      do:
      
          Post.unscoped.ordered
      
      This is because the default scope would already be bound up in the
      "ordered" scope, and therefore wouldn't be removed by the
      "Post.unscoped" part.
      
      In 4.0, we have deprecated all "eager" forms of scopes. So now you must
      write:
      
          class Post < ActiveRecord::Base
            default_scope { where(published: true) }
            scope :ordered, -> { order("created_at") }
          end
      
      This prevents the default scope getting bound up inside the "ordered"
      scope, which means we can now have a simpler/better/more natural
      implementation of default scoping.
      
      A knock on effect is that some things that didn't work properly now do.
      For example it was previously impossible to use #except to remove a part
      of the default scope, since the default scope was evaluated after the
      call to #except.
      94924dc3
  21. 18 6月, 2013 1 次提交
  22. 13 5月, 2013 1 次提交
  23. 10 5月, 2013 1 次提交
  24. 08 4月, 2013 1 次提交
  25. 03 4月, 2013 2 次提交
  26. 30 3月, 2013 1 次提交
  27. 15 3月, 2013 1 次提交
    • Y
      rename `Relation#uniq` to `Relation#distinct`. `#uniq` still works. · a1bb6c8b
      Yves Senn 提交于
      The similarity of `Relation#uniq` to `Array#uniq` is confusing. Since our
      Relation API is close to SQL terms I renamed `#uniq` to `#distinct`.
      
      There is no deprecation. `#uniq` and `#uniq!` are aliases and will continue
      to work. I also updated the documentation to promote the use of `#distinct`.
      a1bb6c8b
  28. 02 3月, 2013 1 次提交
    • Y
      deal with `#append` and `#prepend` on association collections. · b9399c47
      Yves Senn 提交于
      Closes #7364.
      
      Collection associations behave similar to Arrays. However there is no
      way to prepend records. And to append one should use `<<`. Before this
      patch `#append` and `#prepend` did not add the record to the loaded
      association.
      
      `#append` now behaves like `<<` and `#prepend` is not defined.
      b9399c47
  29. 01 3月, 2013 1 次提交
  30. 18 1月, 2013 1 次提交
  31. 07 1月, 2013 1 次提交
  32. 05 12月, 2012 1 次提交
    • C
      Replace comments' non-breaking spaces with spaces · 019df988
      claudiob 提交于
      Sometimes, on Mac OS X, programmers accidentally press Option+Space
      rather than just Space and don’t see the difference. The problem is
      that Option+Space writes a non-breaking space (0XA0) rather than a
      normal space (0x20).
      
      This commit removes all the non-breaking spaces inadvertently
      introduced in the comments of the code.
      019df988