1. 13 1月, 2014 1 次提交
  2. 04 1月, 2014 1 次提交
  3. 04 10月, 2013 1 次提交
  4. 02 4月, 2013 1 次提交
  5. 18 3月, 2013 1 次提交
  6. 11 3月, 2013 1 次提交
  7. 06 3月, 2013 1 次提交
  8. 29 11月, 2012 2 次提交
  9. 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
  10. 04 9月, 2012 2 次提交
  11. 03 9月, 2012 1 次提交
    • Y
      set the configured #inheritance_column on #become (#7503) · 20574956
      Yves Senn 提交于
      I had to create a new table because I needed an STI table,
      which does not have both a "type" and a "custom_type"
      
      the test fails with:
        1) Error:
      test_alt_becomes_works_with_sti(InheritanceTest):
      NoMethodError: undefined method `type=' for #<Cabbage id: 1, name: "my cucumber", custom_type: "Cucumber">
          /Users/username/Projects/rails/activemodel/lib/active_model/attribute_methods.rb:432:in `method_missing'
          /Users/username/Projects/rails/activerecord/lib/active_record/attribute_methods.rb:100:in `method_missing'
          /Users/username/Projects/rails/activerecord/lib/active_record/persistence.rb:165:in `becomes'
          test/cases/inheritance_test.rb:134:in `test_becomes_works_with_sti'
          test/cases/inheritance_test.rb:140:in `test_alt_becomes_works_with_sti'
      20574956
  12. 03 8月, 2012 1 次提交
    • J
      Remove ActiveRecord::Base.to_a · 55b24888
      Jon Leighton 提交于
      On reflection, it seems like a bit of a weird method to have on
      ActiveRecord::Base, and it shouldn't be needed most of the time anyway.
      55b24888
  13. 28 7月, 2012 1 次提交
  14. 27 7月, 2012 2 次提交
    • J
      ActiveRecord::Base.all returns a Relation. · 6a81ccd6
      Jon Leighton 提交于
      Previously it returned an Array.
      
      If you want an array, call e.g. `Post.to_a` rather than `Post.all`. This
      is more explicit.
      
      In most cases this should not break existing code, since
      Relations use method_missing to delegate unknown methods to #to_a
      anyway.
      6a81ccd6
    • B
      Refactor ActiveRecord::Inheritance.base_class logic · d0aebd53
      beerlington 提交于
      Moved logic from class_of_active_record_descendant(class) to the
      base_class method. This method was confusing because it required
      an argument, but that argument was 'self'.
      
      Moved base_class tests to inheritance_test.rb and added some test
      coverage for some untested cases.
      d0aebd53
  15. 27 4月, 2012 4 次提交
  16. 29 12月, 2011 1 次提交
  17. 30 11月, 2011 1 次提交
  18. 07 6月, 2011 1 次提交
  19. 05 6月, 2011 1 次提交
    • J
      Refactor Active Record test connection setup. Please see the... · 253bb6b9
      Jon Leighton 提交于
      Refactor Active Record test connection setup. Please see the RUNNING_UNIT_TESTS file for details, but essentially you can now configure things in test/config.yml. You can also run tests directly via the command line, e.g. ruby path/to/test.rb (no rake needed, uses default db connection from test/config.yml). This will help us fix the CI by enabling us to isolate the different Rails versions to different databases.
      253bb6b9
  20. 01 3月, 2011 1 次提交
  21. 08 1月, 2011 1 次提交
  22. 26 12月, 2010 1 次提交
  23. 25 12月, 2010 1 次提交
  24. 24 11月, 2010 1 次提交
  25. 01 10月, 2010 1 次提交
  26. 29 6月, 2010 1 次提交
    • J
      Add scoping and unscoped as the syntax to replace the old with_scope and... · bd1666ad
      José Valim 提交于
      Add scoping and unscoped as the syntax to replace the old with_scope and with_exclusive_scope. A few examples:
      
      * with_scope now should be scoping:
      
      Before:
      
        Comment.with_scope(:find => { :conditions => { :post_id => 1 } }) do
          Comment.first #=> SELECT * FROM comments WHERE post_id = 1
        end
      
      After:
      
        Comment.where(:post_id => 1).scoping do
          Comment.first #=> SELECT * FROM comments WHERE post_id = 1
        end
      
      * with_exclusive_scope now should be unscoped:
      
        class Post < ActiveRecord::Base
          default_scope :published => true
        end
      
        Post.all #=> SELECT * FROM posts WHERE published = true
      
      Before:
      
        Post.with_exclusive_scope do
          Post.all #=> SELECT * FROM posts
        end
      
      After:
      
        Post.unscoped do
          Post.all #=> SELECT * FROM posts
        end
      
      Notice you can also use unscoped without a block and it will return an anonymous scope with default_scope values:
      
        Post.unscoped.all #=> SELECT * FROM posts
      bd1666ad
  27. 20 5月, 2010 1 次提交
  28. 04 1月, 2010 1 次提交
  29. 07 8月, 2009 1 次提交
  30. 01 7月, 2009 1 次提交
  31. 23 6月, 2009 1 次提交
  32. 22 6月, 2009 1 次提交
  33. 30 4月, 2009 1 次提交
  34. 09 3月, 2009 1 次提交