aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | 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
| * | | | | | Remove warning from access to Bignum class, 2**64 is already a known bignum ↵Vipul A M2016-11-131-1/+0
| |/ / / / / | | | | | | | | | | | | | | | | | | value. See also http://patshaughnessy.net/2014/1/9/how-big-is-a-bignum for smallest bignum value
* | | | | | Merge pull request #27036 from y-yagi/update_turbolinks_exampleRafael França2016-11-131-1/+1
|\ \ \ \ \ \ | |/ / / / / |/| | | | | use correct value in example [ci skip]
| * | | | | use correct value in example [ci skip]yuuji.yaginuma2016-11-141-1/+1
|/ / / / / | | | | | | | | | | | | | | | | | | | | Need to specify `reload` from turbolinks 5. Ref: 7225f0bb9fd1d71a7a37b53815c90178cc7319bd
* | | | | Minor corrections to #26905Andrew White2016-11-132-2/+2
| | | | |
* | | | | Fix typo in constant referenceAndrew White2016-11-131-1/+1
| | | | |
* | | | | It's a NAN not InfinityAndrew White2016-11-131-1/+1
| | | | |
* | | | | Use literal values in assertionsAndrew White2016-11-131-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Using the method you're testing to generate expected values can lead to bugs being masked.
* | | | | Merge pull request #26933 from prathamesh-sonpatki/fix-26877Andrew White2016-11-132-1/+23
|\ \ \ \ \ | | | | | | | | | | | | Fix an issue with JSON encoding of "Infinity" and "NaN" values
| * | | | | Fix an issue with JSON encoding of "Infinity" and "NaN" valuesPrathamesh Sonpatki2016-10-302-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - When `as_json` returns `Infinity` or `NaN` as the value of any of the key, we don't used to call `as_json` on it as it was treated as primitive. - This used to pass `Infinity` or `NaN` to `JSON.generate` and Ruby used to throw an error for `Infinity/NaN not allowed in JSON.` - This patch changes the code to call `as_json` on these primitives so that they are converted to proper values before being passed to `JSON.generate`. - Fixes #26877.
* | | | | | Merge pull request #27024 from vipulnsward/changelog-editsAndrew White2016-11-134-15/+15
|\ \ \ \ \ \ | | | | | | | | | | | | | | Changelog edits
| * | | | | | Changelog editsVipul A M2016-11-124-15/+15
| | |/ / / / | |/| | | |
* | | | | | Merge pull request #26905 from bogdanvlviv/docsAndrew White2016-11-1342-75/+77
|\ \ \ \ \ \ | | | | | | | | | | | | | | Add missing `+` around a some literals.
| * | | | | | Add missing `+` around a some literals.bogdanvlviv2016-10-2742-75/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mainly around `nil` [ci skip]
* | | | | | | removes unconventional "then" in case expressionXavier Noria2016-11-131-1/+1
| | | | | | |
* | | | | | | revises style in recent code (of mine)Xavier Noria2016-11-131-5/+7
| |_|_|_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | This alternative case expressions read better for my taste, and look more uniform in a file where other similar case expressions are used (without dynamic clauses).
* | | | | | Merge pull request #27019 from djpowers/patch-1Jon Moss2016-11-122-3/+3
|\ \ \ \ \ \ | | | | | | | | | | | | | | Fix spelling in API documentation
| * | | | | | Fix spelling in API docsDave Powers2016-11-122-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | [ci skip]
* | | | | | | Add test for #25248Sean Griffin2016-11-121-0/+10
| | | | | | |
* | | | | | | Merge pull request #25248 from bluesh55:features/skip-coffeeSean Griffin2016-11-121-1/+6
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Add --skip-coffee generating option
| * | | | | | | Add --skip-coffee generating optionseunghwan oh2016-06-021-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Usage `rails new awesome-project --skip-coffee`
* | | | | | | | Merge pull request #27022 from kamipo/add_nodoc_to_table_structureAndrew White2016-11-121-9/+2
|\ \ \ \ \ \ \ \ | |_|_|_|/ / / / |/| | | | | | | Add `:nodoc` to `table_structure`
| * | | | | | | Add `:nodoc` to `table_structure`Ryuta Kamizono2016-11-121-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow up to #27008. `table_structure` is an internal method so it is better to hide it in the doc. And alias `table_structure` to `column_definitions` to remove the duplicated `columns` method in the sqlite3 adapter.
* | | | | | | | significant speedup of AC::Parameters#permitXavier Noria2016-11-122-1/+8
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current implementation of AC::Parameters#permit builds permitted hashes and then calls permit! on them. This filtering is recursive, so we call permit! on terminal branches, but then ascendants call permit! on themselves when the recursion goes up the stack, which recurses all the way down again because permit! is recursive itself. Repeat this for every parent node and you get some scary O-something going on that I don't even want to compute. Instead, since the whole point of the permit recursion is to build permitted hashes along the way and at that point you know you've just come up with a valid filtered version, you can already switch the toggle on the spot. I have seen 2x speedups in casual benchmarks with small structures. As the previous description shows, the difference in performance is going to be a function of the nesting. Note that that the involved methods are private and used only by permit.
* | | | | | | Merge pull request #27018 from ↵Vipul A M2016-11-111-0/+12
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | alexanderkustov/alexanderkustov/update-docs-ActionView better docs for ActionView::ViewPaths#prepend_view_path [ci skip]
| * | | | | | | better docs for ActionView::ViewPaths#prepend_view_pathAlexander Kustov2016-11-121-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ✂️ extra line
* | | | | | | | adds a missing dot [ci skip]Xavier Noria2016-11-111-1/+1
| | | | | | | |
* | | | | | | | adds support for arbitrary hashes in strong parametersXavier Noria2016-11-114-3/+101
| |_|/ / / / / |/| | | | | |
* | | | | | | Merge pull request #27008 from kirs/new-column-from-fieldRafael França2016-11-114-38/+48
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | Refactor column initialization into `new_column_from_field`
| * | | | | | Refactor column initialization into `new_column_from_field`Kir Shatrov2016-11-114-38/+48
|/ / / / / / | | | | | | | | | | | | | | | | | | that accepts results of SHOW FIELDS
* | | | | | Merge pull request #26978 from matthewd/query-cache-poolMatthew Draper2016-11-104-4/+73
|\ \ \ \ \ \ | | | | | | | | | | | | | | Configure query caching (per thread) on the connection pool
| * | | | | | Configure query caching (per thread) on the connection poolMatthew Draper2016-11-064-2/+71
| | | | | | |
| * | | | | | Try harder to avoid making a connection while releasing itMatthew Draper2016-11-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | connected? doesn't mean what we need here.
* | | | | | | Merge pull request #27006 from bogdanvlviv/ar_querying_guideJon Moss2016-11-101-0/+3
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Update guides/source/active_record_querying.md
| * | | | | | | Update guides/source/active_record_querying.mdbogdanvlviv2016-11-101-0/+3
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add info about updating locking column value Follow #26050 and #26871 [ci skip]
* | | | | | | Merge pull request #26820 from y-yagi/add_bang_merge_to_parametersRafael França2016-11-103-0/+28
|\ \ \ \ \ \ \ | |_|_|_|_|/ / |/| | | | | | add `ActionController::Parameters#merge!`