1. 18 11月, 2016 12 次提交
  2. 17 11月, 2016 12 次提交
  3. 16 11月, 2016 8 次提交
    • K
      Run tests by Ruby 2.2.6 and 2.3.2 · 8e239fa7
      Koichi ITO 提交于
      8e239fa7
    • Y
      docs, add `update_all` example with SQL fragment. [ci skip] · 3b2346ea
      Yves Senn 提交于
      The relation method `update_all` allows you to pass a SQL fragment. The
      functionality is already mentioned in the prose but the examples section
      does not cover it.
      3b2346ea
    • G
      Merge pull request #27056 from kirs/fix-testing-isolation · c2c6b7be
      Guillermo Iguaran 提交于
      Fix testing isolation
      c2c6b7be
    • J
      Merge pull request #27058 from maclover7/jm-fix-26904 · bce3d1f8
      Jon Moss 提交于
      Support AC::Parameters for PG HStore
      bce3d1f8
    • J
      Support AC::Parameters for PG HStore · 0a8b212d
      Jon Moss 提交于
      As reported via #26904, there is a regression in how values for
      Postgres' HStore column type are being processed, beginning in Rails 5.
      Currently, the way that Active Record checks whether or not values need
      to be serialized and put into the correct storage format is whether or
      not it is a `Hash` object. Since `ActionController::Parameters` no
      longer inherits from `Hash` in Rails 5, this conditional now returns
      false. To remedy this, we are now checking to see whether the `value`
      parameters being passed in responds to a certain method, and then
      calling the `serialize` method, except this time with a real Hash
      object. Keeping things DRY!
      
      Fixes #26904.
      0a8b212d
    • K
      Fix testing isolation · 32614704
      Kir Shatrov 提交于
      AS::Testing::Isolation has two ways to isolate the process:
      forking and subprocessing. The second way is used on JRuby and other
      platforms that don't support forking.
      
      The way how subprocessing works is that we prepare a command to run a
      new process:
      
      ```
      /opt/rubies/2.3.0/bin/ruby -I{skipped_load_path} test/initializable_test.rb '' -nInitializableTests::Basic#test_Initializer_provides_context's_class_name
      ```
      
      As you see, there's unescaped quote at the end of the line.
      It leads to:
      
      ```
      sh: -c: line 0: unexpected EOF while looking for matching `''
      sh: -c: line 1: syntax error: unexpected end of file
      ```
      
      This fixes tests on MRI + NO_FORK variable and on JRuby 🎉
      32614704
    • S
      Merge pull request #27054 from kamipo/null_relation_calculate · 6e692e6e
      Sean Griffin 提交于
      Refactor `NullRelation#calculate`
      6e692e6e
    • R
      Refactor `NullRelation#calculate` · 7c1b14f0
      Ryuta Kamizono 提交于
      Before:
      
      ```ruby
          def calculate(operation, _column_name)
            if [:count, :sum].include? operation
              group_values.any? ? Hash.new : 0
            elsif [:average, :minimum, :maximum].include?(operation) && group_values.any?
              Hash.new
            else
              nil
            end
          end
      ```
      
      After:
      
      ```ruby
          def calculate(operation, _column_name)
            case operation
            when :count, :sum
              group_values.any? ? Hash.new : 0
            when :average, :minimum, :maximum
              group_values.any? ? Hash.new : nil
            end
          end
      ```
      7c1b14f0
  4. 15 11月, 2016 8 次提交