Commit Graph

70943 Commits

Author SHA1 Message Date
Rafael França
662f14814e
Merge pull request #34681 from gmcgibbon/fix_boolean_system_test_scaffold
Fix boolean interaction in scaffold system tests
2018-12-12 11:42:16 -05:00
Ryuta Kamizono
b0ac3694e6
Merge pull request #34689 from haruelico/beanstalkd
kr/beanstalkd permanently moved to beanstalkd/beanstalkd
2018-12-13 01:10:04 +09:00
Gannon McGibbon
ea89b4588b Fix boolean interaction in scaffold system tests 2018-12-12 10:56:25 -05:00
Harue Lico
f4a7144138 kr/beanstalkd permanently moved to beanstalkd/beanstalkd
https://github.com/kr/beanstalkd has moved to
https://github.com/beanstalkd/beanstalkd as permanently.
2018-12-13 00:32:12 +09:00
Kasper Timm Hansen
0fc6804c7e
Merge pull request #34686 from got2be/actioncable-channel-rescuable
Add Missing ActiveSupport::Rescuable to ActionCable::Channel
2018-12-12 15:30:44 +01:00
Ryuta Kamizono
7d83ef4f7b Ensure that preventing writes is invoked before materialize_transactions consistently 2018-12-12 23:14:26 +09:00
Ilia Kasianenko
87f407db3e Add Missing ActiveSupport::Rescuable to ActionCable::Channel
[timthez, Ilia Kasianenko]
2018-12-12 15:48:55 +02:00
Ryuta Kamizono
4dd06452ef
Merge pull request #34682 from gmcgibbon/rm_system_test_generator_suffix
Remove redundant suffixes on generated system tests.
2018-12-12 22:42:45 +09:00
Eileen M. Uchitelle
beb63b2459
Merge pull request #34680 from jhawthorn/connected_to_question
Add ActiveRecord::Base.connected_to?
2018-12-12 07:43:37 -05:00
Yuji Yaginuma
c4f37cc8c5
Merge pull request #34648 from y-yagi/fixes_34646
Make `deprecate` work for non-exists methods
2018-12-12 15:52:08 +09:00
Gannon McGibbon
b93fc47c72 Remove redundant suffixes on generated system tests. 2018-12-11 18:09:16 -05:00
John Hawthorn
b67a3f5cac Add AR::Base.connected_to?
This can be used to check the currently connected role. It's meant to
mirror AR::Base.connected_to
2018-12-11 14:24:02 -08:00
Ryuta Kamizono
5742344024 An empty transaction does not raise the ReadOnlyError if preventing writes
BEGIN transaction would cause COMMIT or ROLLBACK, so unless COMMIT and
ROLLBACK aren't treated as write queries as well as BEGIN, the
`ReadOnlyError` would be raised.
2018-12-11 21:07:37 +09:00
Rafael França
cb714c3687
Merge pull request #34670 from sambostock/prepend-module-in-active-storage-overview
Prepend module in ActiveStorage overview
2018-12-10 19:03:30 -05:00
Sam Bostock
f2935b399b
Prepend module in ActiveStorage overview
[ci skip]
2018-12-10 18:20:23 -05:00
Rafael França
d92331e3b7
Merge pull request #34668 from toy/patch-1
Fix typos in click test descriptions [ci skip]
2018-12-10 18:02:45 -05:00
Ivan Kuchin
1be4edc76f
Fix typos in click test descriptions [ci skip] 2018-12-10 23:44:31 +01:00
Rafael França
b310827506
Merge pull request #34666 from vinistock/upgrade_rubocop_and_fix_offenses
Upgrade Rubocop to 0.61.1 and fix offenses
2018-12-10 17:38:47 -05:00
Ryuta Kamizono
10457475b9 An explain query does not raise the ReadOnlyError if preventing writes 2018-12-11 07:23:00 +09:00
Ryuta Kamizono
07f0f1a8c7 Don't treat begin and rollback transactions as write queries
Otherwise `save` method would raise the `ReadOnlyError` against `BEGIN`
and `ROLLBACK` queries.
2018-12-11 06:40:38 +09:00
Vinicius Stock
3b7a4d3d75
Upgrade Rubocop to 0.61.1 and fix offenses 2018-12-10 19:22:56 -02:00
Ryuta Kamizono
cf71f31e2e Prevent write queries with prepared statements for mysql2 adapter
Without this change, mysql2 adapter with prepared statements won't pass
`base_test.rb`.

```
% ARCONN=mysql2 be ruby -w -Itest test/cases/base_test.rb
Using mysql2
Run options: --seed 27614

# Running:

....S..............................F

Failure:
BasicsTest#test_creating_a_record_raises_if_preventing_writes [test/cases/base_test.rb:1493]:
ActiveRecord::ReadOnlyError expected but nothing was raised.

rails test test/cases/base_test.rb:1492

...F

Failure:
BasicsTest#test_deleting_a_record_raises_if_preventing_writes [test/cases/base_test.rb:1513]:
ActiveRecord::ReadOnlyError expected but nothing was raised.

rails test test/cases/base_test.rb:1510

............................................................................................................F

Failure:
BasicsTest#test_updating_a_record_raises_if_preventing_writes [test/cases/base_test.rb:1503]:
ActiveRecord::ReadOnlyError expected but nothing was raised.

rails test test/cases/base_test.rb:1500

..........

Finished in 2.534490s, 62.7345 runs/s, 149.5370 assertions/s.
159 runs, 379 assertions, 3 failures, 0 errors, 1 skips
```
2018-12-11 05:08:59 +09:00
Ryuta Kamizono
bde898c1df Prevent write queries for exec_query
Follow up #34505.
2018-12-11 04:51:54 +09:00
yuuji.yaginuma
bad1041b82 Add test for reads environment credential file with environment variable key 2018-12-09 15:00:01 +09:00
yuuji.yaginuma
2e7e9fe1dc Do not require webpacker in Active Job integration tests
Because `skip-javascript` option is specified for the dummy application
used in the integration tests.
bdc96802a7/activejob/test/support/integration/helper.rb (L14)
2018-12-08 13:24:22 +09:00
Eileen M. Uchitelle
bdc96802a7
Merge pull request #34632 from rails/rename-write-on-read-error
Rename error that occurs when writing on a read
2018-12-07 17:54:33 -05:00
Bogdan
18f83faf71 #create_or_find_by/!: add more tests and fix docs (#34653)
* `#create_or_find_by/!`: add more tests

* Fix docs of `create_or_find_by`

This method uses `find_by!` internally.
2018-12-08 07:46:30 +09:00
Vipul A M
90c19240c5
Merge pull request #34654 from rantler/fix_small_typo_in_upgrade_docs
Fix typo in per-form CSRF token docs [ci skip]
2018-12-08 07:15:30 +09:00
Randy Antler
af90af42a7 Fix typo in per-form CSRF token docs [ci skip] 2018-12-07 14:14:02 -08:00
Eileen Uchitelle
db54afba2e Rename error that occurs when writing on a read
I originally named this `StatementInvalid` because that's what we do in
GitHub, but `@tenderlove` pointed out that this means apps can't test
for or explitly rescue this error. `StatementInvalid` is pretty broad so
I've renamed this to `ReadOnlyError`.
2018-12-07 08:53:47 -05:00
Ryuta Kamizono
de06d7673e
Merge pull request #34643 from albertoalmagro/move-type-method-to-symbol
Move type method inside ActionDispatch::Journey::Nodes::Symbol
2018-12-07 18:17:49 +09:00
yuuji.yaginuma
59ff1ba30d Make deprecate work for non-exists methods
Before #33325, `deprecate` works for non-exist methods.
This is necessary, for example, if want to deprecate dynamically defined
methods like attributes methods.

Fixes #34646
2018-12-07 18:16:30 +09:00
Alberto Almagro
0086400dd7 Expand metaprogramming for Symbol, Slash and Dot.
This first started with moving type method inside
`ActionDispatch::Journey::Nodes::Symbol`.

`AD::Journey::Nodes::Symbol#type` was generated dynamically with an
`each` block. While this is OK for classes like `AD::Journey::Nodes::Slash`
or `AD::Journey::Nodes::Dot` which don't have further implementation, all
other classes containing more logic have this method defined in their class
body. This patch does the same in this case.

On code review process @kamipo suggested to fully expand over
metaprogramming for Slash and Dot classes, a topic on which I agree with him.
2018-12-07 09:25:10 +01:00
David Rodríguez
f173ec77fc Abort early if generator command fails (#34420)
* No need to go through ruby

* Abort early if a generator command fails

* Reuse `rails_command` method

* Bump thor minimum dependency to 0.20.3

* Add some minimal docs

* Add a changelog entry

* Restore original logging
2018-12-07 15:01:32 +09:00
Rafael França
b86f65a816
Merge pull request #34573 from WoH/firefox-right-click-bug
Prevent non-primary mouse button clicks from triggering click events
2018-12-05 15:57:22 -05:00
Rafael França
d981654649
Merge pull request #34194 from staugaard/staugaard/actioncable_unauthorized
Stop trying to reconnect on unauthorized cable connections
2018-12-05 14:29:52 -05:00
Rafael Mendonça França
884310fdd0
Improve deprecation message for enqueue returning false
And make sure new applications in Rails 6.0 has this config enabled.

Also, improve test coverage and add a CHANGELOG entry.
2018-12-05 13:52:44 -05:00
Mick Staugaard
58dbc1c2ed Stop trying to reconnect on unauthorized cable connections 2018-12-05 10:40:29 -08:00
Ryuta Kamizono
b802e08273
Merge pull request #34626 from gmcgibbon/sqlite_pluck_quoting
Fix join table column quoting with SQLite.
2018-12-06 02:31:27 +09:00
Gannon McGibbon
93f19071ad Fix join table column quoting with SQLite. 2018-12-05 11:56:14 -05:00
Rafael França
299a213a73
Merge pull request #33992 from kirs/enqueue-return-false
Make AJ::Base#enqueue return false if the job wasn't enqueued
2018-12-05 11:24:19 -05:00
Rafael França
647665110f
Merge pull request #34621 from colby-swandale/update-bundler-2
Update bundler to 2.0.0.pre.2
2018-12-05 11:14:51 -05:00
Eileen M. Uchitelle
d76d8f71c5
Merge pull request #34591 from gmcgibbon/new_delivery_job
Add MailDeliveryJob for unified mail delivery
2018-12-05 10:17:00 -05:00
WoH
a2612622e8
Prevent unintended mouse keys from firing click events
Firefox fires click events on left-, right-
and scroll-wheel (any non-primary mouse key) clicks while other browsers don't.
2018-12-05 15:08:14 +01:00
Colby Swandale
d871885c21 update bundler to 2.0.0.pre.2 2018-12-05 19:51:32 +11:00
yuuji.yaginuma
65c4b1b50d Fix unstable test_serialized_attribute_works_under_concurrent_initial_access test
Since bd62389307e138ee0f274a9d62697567a3334ea0, isolate test of `test_serialized_attribute_works_under_concurrent_initial_access` fails.

```
$ ./bin/test -w test/cases/serialized_attribute_test.rb -n test_serialized_attribute_works_under_concurrent_initial_access
Using sqlite3
Run options: -n test_serialized_attribute_works_under_concurrent_initial_access --seed 32129

# Running:

E

Error:
SerializedAttributeTest#test_serialized_attribute_works_under_concurrent_initial_access:
ActiveRecord::StatementInvalid: SQLite3::SQLException: no such table:
```

If duplicate an unloaded model, it seems that method invocation for that class
is not guaranteed. Use the original class to avoid it.
2018-12-05 13:30:43 +09:00
Yuji Yaginuma
3a86599304
Merge pull request #34620 from ysksn/use_safe_navigation_operator_for_railsguides_generator_constructor
Use String for direction of RailsGuides::Generator#new
2018-12-05 13:24:20 +09:00
Yosuke Kabuto
cb343ef672 Use safe nav operator when calling RailsGuides::Generator.new
Use String for direction of RailsGuides::Generator
2018-12-05 12:41:07 +09:00
Rafael França
7849e56ba2
Merge pull request #34617 from blahed/colorize-unpermitted-params
Colorize the unpermitted params log message
2018-12-04 19:03:27 -05:00
Gannon McGibbon
d4ad9b2fc1
Merge pull request #34563 from sambostock/improve-test-helper-guides
Add advanced test helpers docs to guides
2018-12-04 18:48:35 -05:00