1. 23 12月, 2013 5 次提交
  2. 22 12月, 2013 1 次提交
  3. 21 12月, 2013 1 次提交
  4. 20 12月, 2013 5 次提交
  5. 19 12月, 2013 7 次提交
  6. 18 12月, 2013 5 次提交
  7. 17 12月, 2013 5 次提交
    • L
      Create a blacklist to disallow mutator methods to be delegated to `Array`. · d4ee09cd
      Lauro Caetano 提交于
      This change was necessary because the whitelist wouldn't work.
      It would be painful for users trying to update their applications.
      
      This blacklist intent to prevent odd bugs and confusion in code that call mutator
      methods directely on the `Relation`.
      d4ee09cd
    • C
    • J
      MySQL: remove the old-school 'packets out of order' message · c28d0f20
      Jeremy Kemper 提交于
      Blast from the past, MySQL 4 era, when the password hashing style changed.
      c28d0f20
    • A
      687cd75f
    • M
      Better support for `where()` conditions that use an association name. · 8062a307
      Martin Emde 提交于
      Using the name of an association in `where` previously worked only
      if the value was a single `ActiveRecrd::Base` object. e.g.
      
          Post.where(author: Author.first)
      
      Any other values, including `nil`, would cause invalid SQL to be
      generated. This change supports arguments in the `where` query
      conditions where the key is a `belongs_to` association name and the
      value is `nil`, an `Array` of `ActiveRecord::Base` objects, or an
      `ActiveRecord::Relation` object.
      
          # Given the Post model
          class Post < ActiveRecord::Base
            belongs_to :author
          end
      
          # nil value finds records where the association is not set
          Post.where(author: nil)
          # SELECT "posts".* FROM "posts" WHERE "posts"."author_id" IS NULL
      
          # Array values find records where the association foreign key
          # matches the ids of the passed ActiveRecord models, resulting
          # in the same query as Post.where(author_id: [1,2])
          authors_array = [Author.find(1), Author.find(2)]
          Post.where(author: authors_array)
      
          # ActiveRecord::Relation values find records using the same
          # query as Post.where(author_id: Author.where(last_name: "Emde"))
          Post.where(author: Author.where(last_name: "Emde"))
      
      Polymorphic `belongs_to` associations will continue to be handled
      appropriately, with the polymorphic `association_type` field added
      to the query to match the base class of the value. This feature
      previously only worked when the value was a single `ActveRecord::Base`.
      
          class Post < ActiveRecord::Base
            belongs_to :author, polymorphic: true
          end
      
          Post.where(author: Author.where(last_name: "Emde"))
          # Generates a query similar to:
          Post.where(author_id: Author.where(last_name: "Emde"), author_type: "Author")
      8062a307
  8. 16 12月, 2013 4 次提交
  9. 15 12月, 2013 1 次提交
  10. 14 12月, 2013 2 次提交
  11. 13 12月, 2013 4 次提交