1. 30 1月, 2012 1 次提交
  2. 28 1月, 2012 1 次提交
  3. 27 1月, 2012 2 次提交
  4. 26 1月, 2012 4 次提交
  5. 25 1月, 2012 2 次提交
    • P
      Handle nil in add_index :length option in MySQL · 6cde635f
      Paul Sadauskas 提交于
      Our schema.rb is being generated with an `add_index` line similar to this:
      
          add_index "foo", ["foo", "bar"], :name => "xxx", :length => {"foo"=>8, "bar=>nil}
      
      This is the same as it was on Rails 3.1.3, however, now when that
      schema.rb is evaluated, its generating bad SQL in MySQL:
      
          Mysql::Error: You have an error in your SQL syntax; check the manual
          that corresponds to your MySQL server version for the right syntax
          to use near '))' at line 1: CREATE UNIQUE INDEX
          `xxx` ON `foo` (`foo`(8), `bar`())
      
      This commit adds a check for nil on the length attribute to prevent the
      empty parens from being output.
      6cde635f
    • A
      Moving AR::TestCase in to the AR tests directory · dcf0558a
      Aaron Patterson 提交于
      dcf0558a
  6. 22 1月, 2012 1 次提交
  7. 21 1月, 2012 3 次提交
  8. 20 1月, 2012 1 次提交
  9. 19 1月, 2012 1 次提交
    • O
      Add ActiveRecord::Base#with_lock · 7afbc89c
      Olek Janiszewski 提交于
      Add a `with_lock` method to ActiveRecord objects, which starts
      a transaction, locks the object (pessimistically) and yields to the block.
      The method takes one (optional) parameter and passes it to `lock!`.
      
      Before:
      
          class Order < ActiveRecord::Base
            def cancel!
              transaction do
                lock!
                # ... cancelling logic
              end
            end
          end
      
      After:
      
          class Order < ActiveRecord::Base
            def cancel!
              with_lock do
                # ... cancelling logic
              end
            end
          end
      7afbc89c
  10. 18 1月, 2012 1 次提交
  11. 17 1月, 2012 22 次提交
  12. 16 1月, 2012 1 次提交