1. 04 5月, 2013 2 次提交
    • A
      Squashed commit of the following: · 4c242e6d
      Aaron Patterson 提交于
      commit 2683de5da85135e8d9fe48593ff6167db9d64b18
      Author: Aaron Patterson <aaron.patterson@gmail.com>
      Date:   Fri May 3 11:29:20 2013 -0700
      
          cannot support infinite ranges right now
      
      commit cebb6acef2c3957f975f6db4afd849e535126253
      Author: Aaron Patterson <aaron.patterson@gmail.com>
      Date:   Fri May 3 11:26:12 2013 -0700
      
          reverting infinity comparison
      
      commit 385f7e6b4efd1bf9b89e8d607fcb13e5b03737ea
      Author: Aaron Patterson <aaron.patterson@gmail.com>
      Date:   Fri May 3 11:23:28 2013 -0700
      
          Revert "Added ability to compare date/time with infinity"
      
          This reverts commit 38f28dca.
      
          Conflicts:
          	activesupport/CHANGELOG.md
          	activesupport/lib/active_support/core_ext/numeric/infinite_comparable.rb
          	activesupport/test/core_ext/date_ext_test.rb
          	activesupport/test/core_ext/date_time_ext_test.rb
          	activesupport/test/core_ext/numeric_ext_test.rb
          	activesupport/test/core_ext/time_ext_test.rb
          	activesupport/test/core_ext/time_with_zone_test.rb
      
      commit 0d799a188dc12b18267fc8421675729917610047
      Author: Aaron Patterson <aaron.patterson@gmail.com>
      Date:   Fri May 3 11:18:53 2013 -0700
      
          Revert "Refactor infinite comparable definition a bit"
      
          This reverts commit dd3360e0.
      
      commit 42dec90e49745bbfae546f0560b8783f6b48b074
      Author: Aaron Patterson <aaron.patterson@gmail.com>
      Date:   Fri May 3 11:18:47 2013 -0700
      
          Revert "Require 'active_support/core_ext/module/aliasing' in the infinite_comparable module"
      
          This reverts commit 7003e71c.
      4c242e6d
    • P
      Fix generating route from engine to other engine · 9a4268db
      Piotr Sarnacki 提交于
      A regression was introduced in 5b3bb6, generating route from within an
      engine to an another engine resulted in prefixing a path with the
      SCRIPT_NAME value.
      
      The regression was caused by the fact that SCRIPT_NAME should be
      appended only if it's the SCRIPT_NAME for the application, not if it's
      SCRIPT_NAME from the current engine.
      
      closes #10409
      9a4268db
  2. 03 5月, 2013 15 次提交
    • J
      Merge pull request #9426 from exviva/nested_attributes_reuse_existing_new_record · f1af9f83
      Jon Leighton 提交于
      Do not overwrite manually built records during one-to-one nested attribute assignment
      f1af9f83
    • O
      Do not overwrite manually built records during one-to-one nested attribute assignment · 534030cf
      Olek Janiszewski 提交于
      For one-to-one nested associations, if you build the new (in-memory)
      child object yourself before assignment, then the NestedAttributes
      module will not overwrite it, e.g.:
      
          class Member < ActiveRecord::Base
            has_one :avatar
            accepts_nested_attributes_for :avatar
      
            def avatar
              super || build_avatar(width: 200)
            end
          end
      
          member = Member.new
          member.avatar_attributes = {icon: 'sad'}
          member.avatar.width # => 200
      534030cf
    • J
      Merge pull request #10417 from jholton/fix_association_auto_save · 6023a504
      Jon Leighton 提交于
      autosave_association issue that occurs when table has unique index (resubmission)
      6023a504
    • C
      Merge pull request #10413 from vipulnsward/change_grouping · 84139bad
      Carlos Antonio da Silva 提交于
      Use faster Array.new instead of []*padding
      84139bad
    • J
      Revert "Merge pull request #10433 from wangjohn/making_callbacks_more_performant" · 30f297be
      Jon Leighton 提交于
      This reverts commit 09751fdc, reversing
      changes made to 6a5ab08d.
      
      This change caused a failure in
      actionpack/test/abstract/callbacks_test.rb.
      30f297be
    • J
      Work around change in how MiniTest detects SIGINFO · ffaceaa8
      Jon Leighton 提交于
      MiniTest 4.7.3 detects the presence of SIGINFO and stores the answer in
      a constant.
      
      It seems that MiniTest 4.7.4 changes this, and instead relies on an
      info_signal method being implemented on the runner object.
      
      In ActiveSupport::Testing::Isolation, we use ProxyTestResult to stand in
      for the runner object. This object implements `method_missing`, and as
      such its #info_signal method has a truthy return value. This results in
      MiniTest trying to install the SIGINFO handler on platforms where
      SIGINFO does not exists.
      
      To fix, I am simply defining an explicit ProxyTestResult#info_signal
      method.
      ffaceaa8
    • J
      Fix broken mysql test · 66982772
      Jon Leighton 提交于
      test_mysql_integer_not_null_defaults in test/cases/defaults_test.rb was
      failing. This test relies on the connection being in strict mode. By
      default a new connection is not in strict mode, but Active Record
      automatically places it in strict mode.
      
      ActiveSchemaTest overwrites the connection's #execute method in order to
      prevent SQL statements from actually being executed. One of the
      operations which is performed in ActiveSchema test is a #recreate_database.
      
      Since 2088bf27, recreate_database on
      mysql or mysql2 will trigger a reconnect.
      
      Due to the implementation of the hacking of #execute in
      ActiveSchemaTest, this reconnect would take place, but the connection
      would *not* be placed in strict mode because #execute had been
      overridden to prevent SQL queries hitting the database.
      
      Therefore, after ActiveSchemaTest, the connection would no longer be in
      strict mode, causing test_mysql_integer_not_null_defaults to fail.
      
      I don't think that the way that ActiveSchemaTest is implemented is
      particularly nice or clean, but I have taken steps to make its hacks
      more isolated - it now create a separate connection object which is
      thrown away after the test, and the hacks are applied on the singleton
      class of this object.
      66982772
    • R
      Merge pull request #10424 from markevich/fix_test_prepare · efaecada
      Rafael Mendonça França 提交于
      Restore ActiveRecord connection to original environment after rake:db:test:prepare task.
      efaecada
    • R
      Merge pull request #10433 from wangjohn/making_callbacks_more_performant · 09751fdc
      Rafael Mendonça França 提交于
      Improving the performance of callbacks
      09751fdc
    • W
      Improving the performance of callbacks by keeping a hash of the · 58151ce4
      wangjohn 提交于
      callbacks in the CallbackChain, so you don't have to iterate over all
      callbacks when checking for duplicates.
      
      Benchmark results when the tests in
      activerecord/test/cases/associations_test.rb were run with and without
      the change:
      
      == On master (when scanning all of the callbacks):
      
       ---------------------------------------------------------
        %   cumulative   self              self     total
       time   seconds   seconds    calls  ms/call  ms/call  name
       ---------------------------------------------------------
      
        1.85     9.26      0.82    18412     0.04     0.05
      ActiveSupport::Callbacks::Callback#matches?
        1.22    12.32      0.54    18412     0.03     0.08
      ActiveSupport::Callbacks::Callback#duplicates?
        0.93    14.61      0.41    19600     0.02     0.21
      ActiveSupport::Callbacks::CallbackChain#remove_duplicates
      
      Finished tests in 1.217065s, 30.4010 tests/s, 53.4072 assertions/s.
       ---------------------------------------------------------
      
      == On my branch (when using a hash to check callback duplication):
      
       ---------------------------------------------------------
        %   cumulative   self              self     total
       time   seconds   seconds    calls  ms/call  ms/call  name
       ---------------------------------------------------------
        0.15    29.63      0.06     1188     0.05     0.72
      ActiveSupport::Callbacks::CallbackChain#handle_duplicates
        0.00    40.50      0.00       84     0.00     0.12
      ActiveSupport::Callbacks::Callback#matches?
        0.00    40.50      0.00       84     0.00     0.12
      ActiveSupport::Callbacks::Callback#duplicates?
        0.00    40.50      0.00       91     0.00     0.22
      ActiveSupport::Callbacks::CallbackChain#scan_and_remove_duplicates
      
      Finished tests in 1.117757s, 33.1020 tests/s, 58.1522 assertions/s.
       ---------------------------------------------------------
      58151ce4
    • R
      Merge pull request #10430 from larskanis/add_sslcompression_to_pg_adapter · 6a5ab08d
      Rafael Mendonça França 提交于
      Add parameter :sslcompression to PostgreSQL adapter.
      6a5ab08d
    • L
      Add parameter :sslcompression to PostgreSQL adapter. · 950ef055
      Lars Kanis 提交于
      It is new in PostgreSQL-9.2 .
      950ef055
    • C
      Merge pull request #10426 from tkrajcar/rescue-h1-fix · a6a84152
      Carlos Antonio da Silva 提交于
      Add styling to h1 for default rescue layout
      a6a84152
    • R
      Merge pull request #10423 from wangjohn/refactoring_testing_rakefile · 927d3453
      Rafael Mendonça França 提交于
      Refactoring the creation of TestTasks to remove code duplication.
      927d3453
    • T
      Add styling to h1 · 3bd887da
      Tim Krajcar 提交于
      3bd887da
  3. 02 5月, 2013 23 次提交