1. 02 7月, 2013 9 次提交
  2. 29 6月, 2013 1 次提交
  3. 28 6月, 2013 2 次提交
    • J
      Apply default scope when joining associations. · 55193e44
      Jon Leighton 提交于
      For example:
      
          class Post < ActiveRecord::Base
            default_scope -> { where published: true }
          end
      
          class Comment
            belongs_to :post
          end
      
      When calling `Comment.join(:post)`, we expect to receive only
      comments on published posts, since that is the default scope for
      posts.
      
      Before this change, the default scope from `Post` was not applied,
      so we'd get comments on unpublished posts.
      55193e44
    • Ł
      Remove depreacted finders · 3cc7223f
      Łukasz Strzałkowski 提交于
      They were deprecated in 4.0, planned to remove in 4.1
      3cc7223f
  4. 26 6月, 2013 2 次提交
  5. 25 6月, 2013 1 次提交
  6. 22 6月, 2013 2 次提交
    • N
      flatten merged join_values before building the joins · 32420bd4
      Neeraj Singh 提交于
      fixes #10669
      
      While joining_values special treatment is given to string values.
      By flattening the array it ensures that string values are detected
      as strings and not arrays.
      32420bd4
    • N
      do not load all child records for inverse case · 82882d41
      Neeraj Singh 提交于
      currently `post.comments.find(Comment.first.id)` would load all
      comments for the given post to set the inverse association.
      
      This has a huge performance penalty. Because if post has 100k
      records and all these 100k records would be loaded in memory
      even though the comment id was supplied.
      
      Fix is to use in-memory records only if loaded? is true. Otherwise
      load the records using full sql.
      
      Fixes #10509
      82882d41
  7. 20 6月, 2013 2 次提交
  8. 19 6月, 2013 7 次提交
  9. 15 6月, 2013 3 次提交
  10. 14 6月, 2013 1 次提交
    • A
      Ambiguous reflections are on :through relationships are no longer supported. · b483a0d2
      Aaron Patterson 提交于
      For example, you need to change this:
      
        class Author < ActiveRecord::Base
          has_many :posts
          has_many :taggings, :through => :posts
        end
      
        class Post < ActiveRecord::Base
          has_one :tagging
          has_many :taggings
        end
      
        class Tagging < ActiveRecord::Base
        end
      
      To this:
      
        class Author < ActiveRecord::Base
          has_many :posts
          has_many :taggings, :through => :posts, :source => :tagging
        end
      
        class Post < ActiveRecord::Base
          has_one :tagging
          has_many :taggings
        end
      
        class Tagging < ActiveRecord::Base
        end
      b483a0d2
  11. 12 6月, 2013 1 次提交
  12. 09 6月, 2013 2 次提交
  13. 04 6月, 2013 1 次提交
  14. 28 5月, 2013 2 次提交
  15. 23 5月, 2013 2 次提交
    • Y
      Fix the `:primary_key` option for `has_many` associations. · ef99c114
      Yves Senn 提交于
      When removing records from a `has_many` association it used
      the `primary_key` defined on the association.
      
      Our test suite didn't fail because on all occurences of `:primary_key`,
      the specified column was available in both tables. This prevented the
      code from raising an exception but it still behaved badly.
      
      I added a test-case to prevent regressions that failed with:
      
      ```
        1) Error:
      HasManyAssociationsTest#test_has_many_assignment_with_custom_primary_key:
      ActiveRecord::StatementInvalid: SQLite3::SQLException: no such column: essays.first_name: UPDATE "essays" SET "writer_id" = NULL WHERE "essays"."writer_id" = ? AND "essays"."first_name" IS NULL
      ```
      ef99c114
    • R
      Add CHANGELOG entry for 99860582 · 30d28b19
      Rafael Mendonça França 提交于
      30d28b19
  16. 18 5月, 2013 1 次提交
  17. 15 5月, 2013 1 次提交