aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Use named parameters instead of `assert_valid_keys`Maxime Boisvert2016-11-161-8/+8
|
* docs, add `update_all` example with SQL fragment. [ci skip]Yves Senn2016-11-161-0/+3
| | | | | | 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.
* Merge pull request #27056 from kirs/fix-testing-isolationGuillermo Iguaran2016-11-151-1/+2
|\ | | | | Fix testing isolation
| * Fix testing isolationKir Shatrov2016-11-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 :tada:
* | Merge pull request #27058 from maclover7/jm-fix-26904Jon Moss2016-11-153-0/+19
|\ \ | | | | | | Support AC::Parameters for PG HStore
| * | Support AC::Parameters for PG HStoreJon Moss2016-11-153-0/+19
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge pull request #27054 from kamipo/null_relation_calculateSean Griffin2016-11-151-5/+4
|\ \ | |/ |/| Refactor `NullRelation#calculate`
| * Refactor `NullRelation#calculate`Ryuta Kamizono2016-11-161-5/+4
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ```
* Make sure to bundle json 2.x on CIAkira Matsuda2016-11-152-0/+4
| | | | | Without this, bundler tries to bundle json 1.8 on Ruby 2.4 in some cases https://travis-ci.org/rails/rails/jobs/175874852
* Merge pull request #27048 from y-yagi/remove_alias_method_chain_from_guideप्रथमेश Sonpatki2016-11-151-50/+0
|\ | | | | remove `alias_method_chain` from guide [ci skip]
| * remove `alias_method_chain` from guide [ci skip]yuuji.yaginuma2016-11-151-50/+0
| | | | | | | | Follow up to 7c848e6dd493ff236d33a0410a92f4c3e5cc3c7f
* | Merge pull request #27047 from y-yagi/remove_duplicated_entryRafael França2016-11-141-4/+0
|\ \ | |/ |/| remove duplicated changelog entry [ci skip]
| * remove duplicated changelog entry [ci skip]yuuji.yaginuma2016-11-151-4/+0
|/
* Merge pull request #27046 from conradbeach/fix-typo-layouts-and-rendering-guideJon Moss2016-11-141-1/+1
|\ | | | | Fix small typo in Layouts and Rendering guide.
| * Fix small typo in Layouts and Rendering guide. [ci skip]Conrad Beach2016-11-141-1/+1
| | | | | | Changed "same way they do" to "same way they are".
* | Missing require string/filters for `squish`Akira Matsuda2016-11-151-0/+2
|/
* Merge pull request #27035 from rails/remove-active-support-deprecationsAndrew White2016-11-1430-685/+76
|\ | | | | Remove Active Support deprecations
| * Remove deprecated class ActiveSupport::Concurrency::LatchAndrew White2016-11-142-25/+4
| |
| * Remove deprecated separator argument from parameterizeAndrew White2016-11-145-44/+6
| |
| * Remove deprecated method Numeric#to_formatted_sAndrew White2016-11-143-11/+4
| |
| * Remove deprecated method alias_method_chainAndrew White2016-11-143-263/+4
| |
| * Remove deprecated constant MissingSourceFIleAndrew White2016-11-143-10/+4
| |
| * Remove deprecated Module.qualified_const_get/set/defined?Andrew White2016-11-145-190/+5
| |
| * Update CHANGELOGAndrew White2016-11-131-0/+48
| |
| * Remove deprecated :prefix optionAndrew White2016-11-133-37/+1
| |
| * Remove deprecated new_from_hash_copying_defaultAndrew White2016-11-132-16/+0
| |
| * Remove deprecated time marshal core_ext fileAndrew White2016-11-131-3/+0
| |
| * Remove deprecated struct core_ext fileAndrew White2016-11-131-3/+0
| |
| * Remove deprecated module method_transplanting fileAndrew White2016-11-131-3/+0
| |
| * Remove deprecated local_constantsAndrew White2016-11-132-18/+0
| |
| * Remove deprecated kernel debugger fileAndrew White2016-11-131-3/+0
| |
| * Remove deprecated namespaced_keyAndrew White2016-11-132-14/+0
| |
| * Remove deprecated set_cache_valueAndrew White2016-11-132-17/+0
| |
| * Remove deprecated escape_keyAndrew White2016-11-132-14/+0
| |
| * Remove deprecated key_file_pathAndrew White2016-11-132-14/+0
| |
* | Merge pull request #27040 from ↵Rafael França2016-11-143-1/+13
|\ \ | | | | | | | | | | | | ttanimichi/add-skip-sprockets-to-passthrough-options Add `:skip_sprockets` to `Rails::PluginBuilder::PASSTHROUGH_OPTIONS`
| * | Add `:skip_sprockets` to `Rails::PluginBuilder::PASSTHROUGH_OPTIONS`Tsukuru Tanimichi2016-11-143-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `rails plugin new` with `--full` and `--skip-sprockets` options generates a dummy application that throws `NoMethodError`. ``` % rails plugin new my_engine -S --full --skip-gemspec % cd my_engine % bin/rails test rails aborted! NoMethodError: undefined method `assets' for #<Rails::Application::Configuration:0x007f83aa1e6100> ```
* | | Fix style violationsRafael Mendonça França2016-11-142-2/+2
| | |
* | | Revert "Merge pull request #25811 from oss92/to_sentence_fallback_string"Rafael Mendonça França2016-11-143-20/+3
|/ / | | | | | | | | | | | | | | This reverts commit bad3a120f1690f393d8f6204b3ceee60f0ce707b, reversing changes made to 2384317465ccb1dfca456a2b7798714b99f32711. Reason: Adding a new option in the API for something that can be done with a `#presence` check could do.
* | Merge pull request #27007 from maclover7/jm-fix-26912Rafael Mendonça França2016-11-132-2/+12
|\ \ | | | | | | | | | Don't error on an empty CONTENT_TYPE
| * | Don't error on an empty CONTENT_TYPEJon Moss2016-11-102-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit prevents a possible issue wherein an empty CONTENT_TYPE header is sent in a request to a Rails application, and then `request.content_mime_type` would return `nil`. This is because the `has_content_type?` guard method was not properly checking the validity of a request's content type; it was only checking to see whether or not the header existed, not whether it had a value stored inside. Relatedly, after an internal discussion, it was determined that the `has_content_type?` method is not meant to be part of the public API, and is therefore changed to a `:nodoc:` method in this commit. The test for this behavior is a little bit ugly, for two reasons. One is that it was difficult to determine where to place the test... I figured the best place would be with the rest of the ParamsWrapper stuff, since that's where the original issue was. Also, we have to do some fancy footwork in calling `dispatch` on the test's controller manually... this is because `ActionController::TestCase` will throw an error if you try and pass in a nil content type, which is exactly what we are trying to test here... Because of that, we have to manually call in to the controller, and bypass the `post` request helper. Fixes #26912. This is a regression in behavior between Rails versions 4.2.x and 5.0.x, which was introduced via [this commit](https://github.com/rails/rails/commit/a9f28600e901b11a9222e34bfae8642bfb753186).
* | | Merge pull request #26222 from vipulnsward/26134-fixRafael França2016-11-133-7/+18
|\ \ \ | | | | | | | | Format and send logs to logger.fatal from DebugExceptions
| * | | Format and send logs to logger.fatal from DebugExceptions instead of calling ↵Vipul A M2016-11-123-7/+18
| | | | | | | | | | | | | | | | | | | | | | | | fatal multiple times. Expose tags_text from TaggedLogging to be used for log formatting Fixes #26134
* | | | Merge pull request #27030 from kamipo/avoid_build_preloaderRafael França2016-11-131-2/+3
|\ \ \ \ | | | | | | | | | | Avoid `build_preloader` if preloading is not needed
| * | | | Avoid `build_preloader` if preloading is not neededRyuta Kamizono2016-11-141-2/+3
| | |_|/ | |/| |
* | | | Merge pull request #27037 from kamipo/call_spawn_and_bang_method_for_noneMatthew Draper2016-11-131-1/+1
|\ \ \ \ | | | | | | | | | | Call `spawn` and bang method for `none`
| * | | | Call `spawn` and bang method for `none`Ryuta Kamizono2016-11-141-1/+1
|/ / / / | | | | | | | | | | | | All query methods calls `spawn` and bang method, but only `none` is not.
* | | | Merge pull request #26928 from kamipo/fix_name_error_2Rafael França2016-11-131-2/+2
|\ \ \ \ | | | | | | | | | | Fix NameError: undefined local variable or method `result`
| * | | | Fix NameError: undefined local variable or method `result`Ryuta Kamizono2016-11-141-2/+2
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Caused by 007e50d8e5a900547471b6c4ec79d9d217682c5d. https://github.com/rails/rails/pull/26925 was closed in favor of dcb364e. But dcb364e is only fixed sqlite3 adapter and still broken mysql2 adapter with `prepared_statements: true` (`exec_stmt_and_free`). ```diff diff --git a/activerecord/test/config.example.yml b/activerecord/test/config.example.yml index 58e2d45..7b3c1a6 100644 --- a/activerecord/test/config.example.yml +++ b/activerecord/test/config.example.yml @@ -56,9 +56,11 @@ connections: username: rails encoding: utf8 collation: utf8_unicode_ci + prepared_statements: true arunit2: username: rails encoding: utf8 + prepared_statements: true oracle: arunit: ``` ``` % be rake test_mysql2 --verbose ... Using mysql2 /Users/kamipo/src/github.com/rails/rails/activerecord/lib/active_record/connection_adapters/mysql/database_statements.rb:90: warning: assigned but unused variable - result /Users/kamipo/src/github.com/rails/rails/activerecord/lib/active_record/connection_adapters/mysql/database_statements.rb:101:in `block in exec_stmt_and_free': NameError: undefined local variable or method `result' for #<ActiveRecord::ConnectionAdapters::Mysql2Adapter:0x007fe2c50eb140>: SELECT `ar_internal_metadata`.* FROM `ar_internal_metadata` WHERE `ar_internal_metadata`.`key` = ? LIMIT ? (ActiveRecord::StatementInvalid) from /Users/kamipo/src/github.com/rails/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:586:in `block in log' ... ```
* | | | Merge pull request #27033 from vipulnsward/fix-bignum-warningRafael França2016-11-131-1/+0
|\ \ \ \ | | | | | | | | | | Remove warning from Bignum constant access