1. 06 7月, 2013 1 次提交
  2. 28 6月, 2013 2 次提交
    • C
      Remove order_values argument now that default_scope is simplified · 5e6de394
      Carlos Antonio da Silva 提交于
      In 94924dc3 the internal default_scope
      implementation has changed making it simpler to follow, meaning that the
      old usage of with_default_scope has been removed.
      
      With that, order_values was the same argument for both calls to
      find_first_with_limit, so remove it and use the existent attribute
      for the sake of clarity/simplification.
      5e6de394
    • 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
  3. 14 6月, 2013 1 次提交
  4. 13 6月, 2013 1 次提交
  5. 10 6月, 2013 2 次提交
  6. 09 6月, 2013 3 次提交
  7. 11 5月, 2013 1 次提交
  8. 10 5月, 2013 8 次提交
  9. 03 4月, 2013 1 次提交
  10. 02 4月, 2013 1 次提交
  11. 27 3月, 2013 1 次提交
  12. 18 3月, 2013 1 次提交
  13. 24 2月, 2013 1 次提交
  14. 04 12月, 2012 1 次提交
  15. 10 11月, 2012 1 次提交
  16. 08 11月, 2012 3 次提交
  17. 26 10月, 2012 1 次提交
    • J
      Remove ActiveRecord::Model · 9e4c41c9
      Jon Leighton 提交于
      In the end I think the pain of implementing this seamlessly was not
      worth the gain provided.
      
      The intention was that it would allow plain ruby objects that might not
      live in your main application to be subclassed and have persistence
      mixed in. But I've decided that the benefit of doing that is not worth
      the amount of complexity that the implementation introduced.
      9e4c41c9
  18. 03 8月, 2012 1 次提交
  19. 31 7月, 2012 1 次提交
  20. 28 7月, 2012 1 次提交
  21. 29 6月, 2012 1 次提交
  22. 25 6月, 2012 1 次提交
  23. 11 6月, 2012 4 次提交
  24. 28 5月, 2012 1 次提交