Commit Graph

65488 Commits

Author SHA1 Message Date
Guillermo Iguaran
28333d62ee
Merge pull request #31236 from y-yagi/use_puma_311_in_new_apps
Use Puma 3.11 in newly generated applications
2017-11-27 00:36:05 -05:00
yuuji.yaginuma
0d8fd6107f Use Puma 3.11 in newly generated applications
In order to use early hints, need to use Puma 3.11.0 or higher.
So, I think that should specify that version in newly generated applications.

Ref: f6f3892f4d
2017-11-27 14:21:57 +09:00
Rafael França
959d7f73a7
Merge pull request #31167 from albertoalmagro/clean-db-ambiguity
Clean database naming ambiguity
2017-11-26 22:00:38 -05:00
Ryuta Kamizono
0e2cd3d749
Add new error class QueryCanceled which will be raised when canceling statement due to user request (#31235)
This changes `StatementTimeout` to `QueryCanceled` for PostgreSQL.

In MySQL, errno 1317 (`ER_QUERY_INTERRUPTED`) is only used when the
query is manually cancelled.

But in PostgreSQL, `QUERY_CANCELED` error code (57014) which is used
`StatementTimeout` is also used when the both case. And, we can not tell
which reason happened.

So I decided to introduce new error class `QueryCanceled` closer to the
error code name.
2017-11-27 11:54:59 +09:00
Ryuta Kamizono
ad0630f0ae
Rename TransactionTimeout to more descriptive LockWaitTimeout (#31223)
Since #31129, new error class `StatementTimeout` has been added.
`TransactionTimeout` is caused by the timeout shorter than
`StatementTimeout`, but its name is too generic. I think that it should
be a name that understands the difference with `StatementTimeout`.
2017-11-27 10:30:25 +09:00
Kasper Timm Hansen
b1f140ef2e
Merge pull request #31229 from y-yagi/remove_field_ids_from_scaffold_form
Remove field ids from scaffold form
2017-11-26 19:45:29 +01:00
eileencodes
d7ab571091 Revert "Merge pull request #31006 from rails/kamipo/ordinal_methods_should_respect_loaded_records"
This reverts commit 0f79ab91150b4cdb6c018530978a3395962c7a02, reversing
changes made to d575f7f2e737739302a0e8210d01c10f5d4e2c35.

This PR philosophically conflicts with #30800 and Matthew thinks we
should hold off merging this until we find concensus. Reverting since
we're about to cut a release for 5.2.
2017-11-26 10:22:54 -05:00
Alberto Almagro
39da171f3c Remove DB naming ambiguity
In some places this file referred to the database in three different ways: database, DB and db. The last one caused confusion with the db namespace and the db folder. This commit removes this ambiguity by using the whole word 'database' everywhere
2017-11-26 11:37:48 +01:00
Matthew Draper
cdc46750ca Revert "Remove stopgap_13632 entirely for now: it doesn't support 2.2.8"
This reverts commit 536d3068b964d5848ebc47292c21c0fb0450c17b.
2017-11-26 20:52:11 +10:30
Matthew Draper
3ba20c7fa2
Merge pull request #31221 from matthewd/flush-idle-connections
Flush idle database connections
2017-11-26 20:02:57 +10:30
Matthew Draper
4b2bbcf897
Merge pull request #31232 from weedySeaDragon/engines-guide-copyediting--neutral-copyediting-171126
minor Engines guide copyedits: neutral language,  verb tense, comma splice [ci skip]
2017-11-26 19:38:51 +10:30
Ashley Engelund (weedySeaDragon @ github)
092d1af137 fix comma splice [ci skip] 2017-11-26 00:47:51 -08:00
Ashley Engelund (weedySeaDragon @ github)
2cec7ccc69 verb tense correction [ci skip] 2017-11-26 00:47:43 -08:00
Ashley Engelund (weedySeaDragon @ github)
ed564f7db7 gendered wording not necessary; changed to neutral [ci skip] 2017-11-26 00:47:29 -08:00
Matthew Draper
c43bcc8125 Let rubygems handle our objection to mysql2 0.4.3 2017-11-26 15:33:49 +10:30
Matthew Draper
9027fafff6 Flush idle database connections 2017-11-26 15:12:50 +10:30
yuuji.yaginuma
fbb8b37347 Remove field ids from scaffold form
This was added with 27f103fc7e3260efe0b8dde66bf5354f2202ee32 for link labels and fields.
However, `form_with` changed to generates ids by default with d3893ec38ec61282c2598b01a298124356d6b35a.
So I think that adding an explicit ids is unnecessary.
2017-11-26 10:08:07 +09:00
yuuji.yaginuma
11720c2347 Remove duplicated form_with_generates_remote_forms setting
When load `5.1` config, `form_with_generates_remote_forms` is set.
89a209f1ab/railties/lib/rails/application/configuration.rb (L86)
2017-11-26 09:37:55 +09:00
Rafael França
89a209f1ab
Merge pull request #31184 from TheSmartnik/fix_record_not_found_on_reload
Provide arguments to RecordNotFound
2017-11-25 15:33:03 -05:00
Rafael França
72dec81206
Merge pull request #31181 from tenshilg/fix-api-guides
Fix names of http authentication modules in api only guides
2017-11-25 15:31:35 -05:00
Rafael Mendonça França
fb30d12670
Renove duplicated and wrong test 2017-11-25 15:24:58 -05:00
Rafael Mendonça França
d82b706184
Add test to make sure form_for is not affected by
form_with_generates_ids
2017-11-25 15:17:31 -05:00
Rafael Mendonça França
aec8464881
Make sure that form_with_generates_ids only affects form_with 2017-11-25 15:08:19 -05:00
Rafael Mendonça França
aee1a2802f
Use parentheses for multi-line method calls
Own style guide says we should be using parentheses for method calls
with arguments.
2017-11-25 14:10:34 -05:00
Nikita Misharin
ae032ec384 Provide arguments to RecordNotFound 2017-11-25 21:57:04 +03:00
Rafael Mendonça França
d3893ec38e
Merge pull request #29439 from npezza93/set-skip-default-ids
Allow skip_default_ids option to be set in form_with
2017-11-25 12:36:17 -05:00
Rafael França
8bc9f51ce6
Merge pull request #30879 from toptal/add_better_logging_to_delayed_job
Improved logging of AJ's DelayedJob wrapper
2017-11-25 12:26:51 -05:00
Rafael Mendonça França
36ac675d2a
Make form_with_generates_ids default in Rails 5.2
When the defaults being loaded are the 5.0 or 5.1 we disable generation
of ids with form_with.
2017-11-25 11:56:31 -05:00
npezza93
260d6f112a
Change form_with to generates ids by default
When `form_with` was introduced we disabled the automatic
generation of ids that was enabled in `form_for`. This usually
is not an good idea since labels don't work when the input
doesn't have an id and it made harder to test with Capybara.

You can still disable the automatic generation of ids setting
`config.action_view.form_with_generates_ids` to `false.`
2017-11-25 11:55:02 -05:00
Rafael Mendonça França
f76ca450f5
Compare the actual string after comparing the HMAC proccessed strings
Even that collisions are unlikely we need to make sure the two strings
are equal.

Timing is not important in this case because this only runs after the
comparison between the SHA256 digested strings returns true.
2017-11-25 11:39:41 -05:00
Rafael Mendonça França
0623b5d194
Merge pull request #24510 from vipulnsward/make-variable_size_secure_compare-public
Make variable_size_secure_compare public
2017-11-25 11:39:37 -05:00
Eileen M. Uchitelle
8c750ffb92
Merge pull request #30510 from yhirano55/add_nodoc_to_activerecord
Add :nodoc: to activerecord [ci skip]
2017-11-25 10:04:08 -05:00
Eileen M. Uchitelle
0f79ab9115
Merge pull request #31006 from rails/kamipo/ordinal_methods_should_respect_loaded_records
Ordinal methods should respect loaded records
2017-11-25 10:00:38 -05:00
Eileen M. Uchitelle
d575f7f2e7
Merge pull request #31226 from fgo/patch-22
Update guide layout [ci skip]
2017-11-25 09:49:51 -05:00
Francis Go
31eabcedb1 Update guide layout [ci skip] 2017-11-25 14:04:42 +00:00
Atul Shimpi
eb6d7d5aa0 [ci skip] SecureRandom should mentioned Win32 CryptoAPI functions ins… (#31225)
* [ci skip] SecureRandom should mentioned Win32 CryptoAPI functions instead of Win32

* Remove functions word
2017-11-25 21:13:17 +10:30
Matthew Draper
3313912de1
Merge pull request #31173 from matthewd/connection-fork-safety
Improve AR connection fork safety
2017-11-25 17:53:57 +10:30
Rafael França
2ec9c532cb
Merge pull request #31215 from dixitp012/fix_rubocop_style_in_railties
Rubocop style: Missing magic comment
2017-11-24 14:47:56 -05:00
Vipul A M
1debdb0966
Merge pull request #30881 from dimroc/master
Update documentation to lead with ajax param `event.detail` [ci skip]
2017-11-25 00:56:06 +05:30
Dimitri Roche
a6b0930ff1 Update documentation to lead with ajax param event.detail 2017-11-24 14:21:47 -05:00
Vipul A M
b1bbbdd535
Merge pull request #31217 from atul-shimpi/master
[ci skip] Rails Associations examples contains ActiveRecord::Base ref…
2017-11-24 22:38:06 +05:30
Vipul A M
65ff01e2d0
Merge pull request #31195 from mltsy/patch-2
Fix tld_length documentation in ActionDispatch::Cookies [ci skip]
2017-11-24 22:32:38 +05:30
Atul Shimpi
d7bfb95832 [ci skip] Rails Associations examples contains ActiveRecord::Base reference instead of ApplicationRecord in images 2017-11-24 22:13:21 +05:30
Dixit Patel
88d9906d2d Rubocop style 2017-11-24 20:11:17 +05:30
Jacek Lachowski
b1fbb6688c Improve DelayedJob wrapper logging
ActiveJob wraps every adapter into its own class, that is later passed
into DelayedJob which is responsible for displaying all the logs.

This change improves the logging so we can easily trace executed
jobs and see meaningful information in the logs.
2017-11-24 10:40:16 +01:00
Avneet Singh Malhotra
b01cc6663f Correct render method's response header's content type for option(:body) from text/html to text/plain. (#31212) 2017-11-24 13:38:21 +05:30
George Claghorn
fbb12910bd Avoid connecting to GCS during app boot 2017-11-23 19:48:25 -05:00
Ryuta Kamizono
a7d7277f94
Merge pull request #31178 from mtsmfm/fix-unstable-test
Fix unstable test test_delegate_socket_errors_to_on_error_handler
2017-11-23 16:55:00 +09:00
Fumiaki MATSUSHIMA
788c908577 Fix unstable test test_delegate_socket_errors_to_on_error_handler
I often face the following error when running test/connection/client_socket_test.rb:

```
$ bin/test test/connection/client_socket_test.rb:38
Run options: --seed 44035

# Running:

F

Failure:
ActionCable::Connection::ClientSocketTest#test_delegate_socket_errors_to_on_error_handler
[/app/actioncable/test/connection/client_socket_test.rb:47]:
--- expected
+++ actual
@@ -1 +1 @@
-["foo"]
+["Broken pipe", "Broken pipe", "Broken pipe", "foo"]
```

It can be reproduced easily by applying the following patch:

```
diff --git a/actioncable/test/connection/client_socket_test.rb b/actioncable/test/connection/client_socket_test.rb
index 2051216010..6bb9f13ea7 100644
--- a/actioncable/test/connection/client_socket_test.rb
+++ b/actioncable/test/connection/client_socket_test.rb
@@ -34,7 +34,8 @@ def on_error(message)
     @server.config.allowed_request_origins = %w( http://rubyonrails.com )
   end

-  test "delegate socket errors to on_error handler" do
+  1000.times do |i|
+  test "delegate socket errors to on_error handler #{i}" do
     run_in_eventmachine do
       connection = open_connection

@@ -47,6 +48,7 @@ def on_error(message)
       assert_equal %w[ foo ], connection.errors
     end
   end
+  end

   test "closes hijacked i/o socket at shutdown" do
     run_in_eventmachine do
```

The cause is writing io from different thread at the same time.

`connection.process` sends handshake message from [StreamEventLoop's thread][] whereas
`connection.handle_open` sends welcome message from current thread.

[StreamEventLoop's thread]: 067fc779c4/actioncable/lib/action_cable/connection/stream_event_loop.rb (L75)
2017-11-23 14:37:06 +09:00
Yuji Yaginuma
d6338ad623
Merge pull request #31194 from yahonda/attributes_before_type_cast_on_boolean_with_jruby
No difference between JRuby and CRuby at test_read_attributes_before_…
2017-11-23 08:22:06 +09:00