1. 05 8月, 2016 2 次提交
  2. 04 8月, 2016 1 次提交
  3. 03 8月, 2016 1 次提交
  4. 28 7月, 2016 4 次提交
  5. 26 7月, 2016 2 次提交
    • R
      Quoting booleans should return a frozen string · a3a6d74c
      Ryuta Kamizono 提交于
      If reuse `QUOTED_TRUE` and `QUOTED_FALSE` without frozen, causing the
      following issue.
      
      ```
      Loading development environment (Rails 5.1.0.alpha)
      irb(main):001:0> ActiveRecord::Base.connection.quote(true) << ' foo'
      => "1 foo"
      irb(main):002:0> ActiveRecord::Base.connection.quote(true) << ' foo'
      => "1 foo foo"
      irb(main):003:0> type = ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter::MysqlString.new
      => #<ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter::MysqlString:0x007fd40c15e018 @precision=nil, @scale=nil, @limit=nil>
      irb(main):004:0> type.serialize(true) << ' bar'
      => "1 foo foo bar"
      irb(main):005:0> type.cast(true) << ' bar'
      => "1 foo foo bar bar"
      ```
      a3a6d74c
    • R
      Extract `type_casted_binds` method · d31c2e2c
      Ryuta Kamizono 提交于
      Because `type_cast` against `binds` always requires
      `attr.value_for_database` and this pattern appears frequently.
      d31c2e2c
  6. 25 7月, 2016 1 次提交
  7. 24 7月, 2016 2 次提交
  8. 19 7月, 2016 2 次提交
  9. 18 7月, 2016 2 次提交
  10. 17 7月, 2016 1 次提交
  11. 16 7月, 2016 1 次提交
  12. 14 7月, 2016 1 次提交
  13. 13 7月, 2016 1 次提交
    • J
      Create connection.active_record notification and use that to ensure that lazy- · 31a8588a
      Jeremy Wadsack 提交于
      loaded model classes have their connections wrapped in transactions.
      
      See #17776
      
      In Rails 4 config.eager_load was changed to false in the test environment. This
      means that model classes that connect to alternate databases with
      establish_connection are not loaded at start up. If use_transactional_fixtures
      is enabled, transactions are wrapped around the connections that have been
      established only at the start of the test suite. So model classes loaded later
      don't have transactions causing data created in the alternate database not to
      be removed.
      
      This change resolves that by creating a new connection.active_record
      notification that gets fired whenever a connection is established. I then added
      a subscriber after we set up transactions in the test environment to listen for
      additional connections and wrap those in transactions as well.
      31a8588a
  14. 12 7月, 2016 1 次提交
  15. 08 7月, 2016 1 次提交
  16. 06 7月, 2016 5 次提交
  17. 02 7月, 2016 2 次提交
  18. 25 6月, 2016 1 次提交
  19. 24 6月, 2016 1 次提交
  20. 14 6月, 2016 1 次提交
  21. 10 6月, 2016 2 次提交
  22. 07 6月, 2016 2 次提交
  23. 02 6月, 2016 1 次提交
    • S
      Fix failing tests · 1b8a7b82
      Sean Griffin 提交于
      Currently CI is broken due to 56a61e0c and c4cb6862. This occurred because
      the failures are not present on SQLite which is what I normally run
      locally before pushing.
      
      The optimizations to our YAML size were dropping mutations, as
      `with_type` didn't set the previous value if it'd already been read
      (that method was never really designed to be used with values on
      individual objects, it was previously only used for defaults). I'm
      questioning whether there's a better place to be handling the exclusion
      of the type, but this will fix the failing build.
      
      Additionally, there was a bug in `remove_foreign_key` if you passed it
      an options hash containing `to_table`. This now occurs whenever removing
      a reference, as we always normalize to a hash.
      
      [Sean Griffin & Ryuta Kamizono]
      1b8a7b82
  24. 01 6月, 2016 1 次提交
    • S
      Respect options passed to `foreign_key` when reverting `add_reference` · 56a61e0c
      Sean Griffin 提交于
      The code incorrectly assumes that the option was written as
      `foreign_key: true`, but that is not always the case. This now mirrors
      the behavior of reverting `add_foreign_key`. The code was changed to use
      kwargs while I was touching it, as well.
      
      This could really use a refactoring to go through the same code paths as
      `add_refernce` in the future, so we don't duplicate default values.
      
      Fixes #25169
      56a61e0c
  25. 31 5月, 2016 1 次提交
    • R
      Do not include default column limit in schema.rb · 706f7e9c
      Ryuta Kamizono 提交于
      Follow up of #20815.
      
      ```ruby
      class CreatePeople < ActiveRecord::Migration[5.0]
        def change
          create_table :people do |t|
            t.integer :int
            t.bigint :bint
            t.text :txt
            t.binary :bin
          end
        end
      end
      ```
      
      Result.
      
      In postgresql and sqlite3 adapters:
      
      ```ruby
      ActiveRecord::Schema.define(version: 20160531141018) do
      
        create_table "people", force: :cascade do |t|
          t.integer "int"
          t.bigint  "bint"
          t.text    "txt"
          t.binary  "bin"
        end
      
      end
      ```
      
      In mysql2 adapter:
      
      ```ruby
      ActiveRecord::Schema.define(version: 20160531141018) do
      
        create_table "people", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t|
          t.integer "int"
          t.bigint  "bint"
          t.text    "txt",  limit: 65535
          t.binary  "bin",  limit: 65535
        end
      
      end
      ```
      
      After this patch:
      
      ```ruby
      ActiveRecord::Schema.define(version: 20160531141018) do
      
        create_table "people", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t|
          t.integer "int"
          t.bigint  "bint"
          t.text    "txt"
          t.binary  "bin"
        end
      
      end
      ```
      706f7e9c