Commit Graph

64226 Commits

Author SHA1 Message Date
Ryuta Kamizono
6089b3140d [ci skip] Postgres --> PostgreSQL 2017-08-08 18:20:44 +09:00
Ryuta Kamizono
75cfb3dbdb Fix random CI failure due to non-deterministic sorting order
It should be sorted to be deterministic executed result.

```
% bundle exec rake test_postgresql --verbose TESTOPTS="--seed=52812"

(snip)

Failure:
HasManyThroughAssociationsTest#test_has_many_association_through_a_has_many_association_to_self [/Users/kamipo/src/github.com/rails/rails/activerecord/test/cases/associations/has_many_through_associations_test.rb:820]:
--- expected
+++ actual
@@ -1 +1 @@
-[#<Person id: 85, primary_contact_id: 84, gender: "M", number1_fan_id: 1, lock_version: 0, comments: nil, followers_count: 0, friends_too_count: 0, best_friend_id: nil, best_friend_of_id: nil, insures: 0, born_at: nil, created_at: "2017-08-08 07:33:52", updated_at: "2017-08-08 07:33:52", first_name: "John">, #<Person id: 1, primary_contact_id: 2, gender: "M", number1_fan_id: 3, lock_version: 0, comments: nil, followers_count: 1, friends_too_count: 1, best_friend_id: nil, best_friend_of_id: nil, insures: 0, born_at: nil, created_at: "2017-08-08 07:33:49", updated_at: "2017-08-08 07:33:49", first_name: "Michael">, #<Person id: 3, primary_contact_id: 2, gender: "F", number1_fan_id: 1, lock_version: 0, comments: nil, followers_count: 1, friends_too_count: 1, best_friend_id: nil, best_friend_of_id: nil, insures: 0, born_at: nil, created_at: "2017-08-08 07:33:49", updated_at: "2017-08-08 07:33:49", first_name: "Susan">]
+#<ActiveRecord::Associations::CollectionProxy [#<Person id: 1, primary_contact_id: 2, gender: "M", number1_fan_id: 3, lock_version: 0, comments: nil, followers_count: 1, friends_too_count: 1, best_friend_id: nil, best_friend_of_id: nil, insures: 0, born_at: nil, created_at: "2017-08-08 07:33:49", updated_at: "2017-08-08 07:33:49", first_name: "Michael">, #<Person id: 3, primary_contact_id: 2, gender: "F", number1_fan_id: 1, lock_version: 0, comments: nil, followers_count: 1, friends_too_count: 1, best_friend_id: nil, best_friend_of_id: nil, insures: 0, born_at: nil, created_at: "2017-08-08 07:33:49", updated_at: "2017-08-08 07:33:49", first_name: "Susan">, #<Person id: 85, primary_contact_id: 84, gender: "M", number1_fan_id: 1, lock_version: 0, comments: nil, followers_count: 0, friends_too_count: 0, best_friend_id: nil, best_friend_of_id: nil, insures: 0, born_at: nil, created_at: "2017-08-08 07:33:52", updated_at: "2017-08-08 07:33:52", first_name: "John">]>
```
2017-08-08 17:54:42 +09:00
Ryuta Kamizono
1561810f38 Merge pull request #30132 from ydakuka/patch-1
[ci skip] Update action_mailer_basics.md
2017-08-08 17:29:58 +09:00
Yauheni Dakuka
51f03dab38 [ci skip] Update action_mailer_basics.md 2017-08-08 11:23:20 +03:00
Claudio B
af954ddd54 [ci skip] Prefer cookies.encrypted over signed (#30129)
In some examples and guides we are recommending to use code like:

```ruby
verified_user = User.find_by(id: cookies.signed[:user_id])
```

My suggestion is to use instead:

```ruby
verified_user = User.find_by(id: cookies.encrypted[:user_id])
```

which invites users to prefer the "newer" encrypted cookies over the
"legacy" signed cookies.
2017-08-07 22:32:03 -05:00
yuuji.yaginuma
f217364893 Deprecate support of older config.ru
Since Rails 4.0, `config.ru` generated by default uses instances of
`Rails.application`.  Therefore, I think that it is good to deprecate
the old behavior.

Related: #9669
2017-08-08 07:47:11 +09:00
chopraanmol1
7919d5ca7b Currently if relation object are passed to where condition for has one or has many association wrong set of primary key and foreign key are selected.
Changed code to use 'join' primary key and foreign key over 'association' primary key and foreign key.
2017-08-08 03:23:45 +05:30
Julia López
f2810f1dab add reload_association to documentation [ci skip] 2017-08-07 17:01:48 -04:00
Yoshiyuki Hirano
8967170164 Fix dummy_app configuration 2017-08-08 04:35:21 +09:00
Yoshiyuki Hirano
1dfc211bfa Use with_dummy_app? in gitignore 2017-08-08 04:25:39 +09:00
Anton Khamets
7c89948c41 Extend image_tag to accept ActiveStorage Attachments and Variants (#30084)
* Extend image_tag to accept ActiveStorage's Attachments and Variants

* Flip resolve_image_source around

* Add tests for the new use-cases of image_tag

* Remove the higher-level test

* Update image_tag documentation

* Add error states into the test suite

* Re-raise polymorhic_url's NoMethodError as ArgumentError

* delegate_missing_to will raise DelegationError instead of NoMethodError
2017-08-07 09:38:51 -05:00
Yoshiyuki Hirano
81a9b59779 Removed empty line from dummy_manifest 2017-08-07 18:59:43 +09:00
dixpac
d44e737a76 Filter out Minitest backtrace.
Filter out Minitest backtrace while allowing backtrace from other
libraries to be shown.
2017-08-07 11:40:20 +02:00
Koichi ITO
7f33b8afa2 Simplify git_source in Gemfile
Follow up of 0b8441bd41
2017-08-07 17:46:48 +09:00
yui-knk
3374da7b14 Add missed require
`ActiveRecord::ConnectionAdapters::QueryCache::ConnectionPoolConfiguration`
depends on `Concurrent::Map`.
2017-08-07 17:38:50 +09:00
bogdanvlviv
82414d397d
Remove :sorted test order for isolated tests 2017-08-07 04:54:31 +00:00
Trevor Wistaff
af3500b188 Deprecate ActionDispatch::TestResponse response aliases
https://github.com/rails/rails/issues/30072
2017-08-07 13:48:02 +10:00
Jon Moss
df94b863c2 Capitalize Rake
Should _probably_ be done across the board with all of our
documentation, but going to leave that for another time :)

[ci skip]
2017-08-06 22:54:23 -04:00
Jon Moss
43a42542e6 Remove extra space between two sentences
[ci skip]
2017-08-06 22:46:15 -04:00
Jon Moss
be60532bdc Lint railties/CHANGELOG.md
Light grammar edits.

[ci skip]
2017-08-06 22:32:26 -04:00
Jon Moss
026d4a2f07 Lint activesupport/CHANGELOG.md
Light grammar edits.

[ci skip]
2017-08-06 22:29:07 -04:00
Jon Moss
f6257aa014 Lint activerecord/CHANGELOG.md
Light grammar fixes, and added a few backticks.

[ci skip]
2017-08-06 22:24:30 -04:00
Jon Moss
b23a01fc36 Lint actionpack/CHANGELOG.md
Fixes a few grammar things.

[ci skip]
2017-08-06 22:17:35 -04:00
Jon Moss
5e222f3d91 Lint actioncable/CHANGELOG.md
Postgres --> PostgreSQL
ActionCable --> Action Cable

[ci skip]
2017-08-06 22:14:10 -04:00
Yasuo Honda
5320bbf5b8 Add :authors fixture to address two random failures at HasOneAssociationsTest
* sqlite3 - 2 failures
```ruby
$ ARCONN=sqlite3 bin/test test/cases/associations/has_one_associations_test.rb test/cases/view_test.rb --seed 48032 -n "/^(?:ViewWithoutPrimaryKeyTest#(?:test_attributes)|HasOneAssociationsTest#(?:test_destroyed_by_association_set_in_child_destroy_callback_on_parent_destroy|test_destroyed_by_association_set_in_child_destroy_callback_on_replace))$/" --verbose
Using sqlite3
Run options: --seed 48032 -n "/^(?:ViewWithoutPrimaryKeyTest#(?:test_attributes)|HasOneAssociationsTest#(?:test_destroyed_by_association_set_in_child_destroy_callback_on_parent_destroy|test_destroyed_by_association_set_in_child_destroy_callback_on_replace))$/" --verbose

ViewWithoutPrimaryKeyTest#test_attributes = 0.02 s = .
HasOneAssociationsTest#test_destroyed_by_association_set_in_child_destroy_callback_on_replace = 0.12 s = F
HasOneAssociationsTest#test_destroyed_by_association_set_in_child_destroy_callback_on_parent_destroy = 0.01 s = F

Finished in 0.162504s, 18.4610 runs/s, 18.4610 assertions/s.

  1) Failure:
HasOneAssociationsTest#test_destroyed_by_association_set_in_child_destroy_callback_on_replace [/home/yahonda/git/rails/activerecord/test/cases/associations/has_one_associations_test.rb:725]:
Expected true to be nil or false

  2) Failure:
HasOneAssociationsTest#test_destroyed_by_association_set_in_child_destroy_callback_on_parent_destroy [/home/yahonda/git/rails/activerecord/test/cases/associations/has_one_associations_test.rb:715]:
Expected true to be nil or false

3 runs, 3 assertions, 2 failures, 0 errors, 0 skips
```

* mysql2 - 1 failure
```
$ ARCONN=mysql2 bin/test test/cases/associations/has_one_associations_test.rb test/cases/view_test.rb --seed 48032 -n "/^(?:ViewWithoutPrimaryKeyTest#(?:test_attributes)|HasOneAssociationsTest#(?:test_destroyed_by_association_set_in_child_destroy_callback_on_parent_destroy|test_destroyed_by_association_set_in_child_destroy_callback_on_replace))$/" --verbose
Using mysql2
Run options: --seed 48032 -n "/^(?:ViewWithoutPrimaryKeyTest#(?:test_attributes)|HasOneAssociationsTest#(?:test_destroyed_by_association_set_in_child_destroy_callback_on_parent_destroy|test_destroyed_by_association_set_in_child_destroy_callback_on_replace))$/" --verbose

ViewWithoutPrimaryKeyTest#test_attributes = 0.07 s = .
HasOneAssociationsTest#test_destroyed_by_association_set_in_child_destroy_callback_on_replace = 0.27 s = F
HasOneAssociationsTest#test_destroyed_by_association_set_in_child_destroy_callback_on_parent_destroy = 0.02 s = .

Finished in 0.362779s, 8.2695 runs/s, 8.2695 assertions/s.

  1) Failure:
HasOneAssociationsTest#test_destroyed_by_association_set_in_child_destroy_callback_on_replace [/home/yahonda/git/rails/activerecord/test/cases/associations/has_one_associations_test.rb:725]:
Expected true to be nil or false

3 runs, 3 assertions, 1 failures, 0 errors, 0 skips
```

* postgresql - 0 failures

```ruby
$ ARCONN=postgresql bin/test test/cases/associations/has_one_associations_test.rb test/cases/view_test.rb --seed 48032 -n "/^(?:ViewWithoutPrimaryKeyTest#(?:test_attributes)|HasOneAssociationsTest#(?:test_destroyed_by_association_set_in_child_destroy_callback_on_parent_destroy|test_destroyed_by_association_set_in_child_destroy_callback_on_replace))$/" --verbose
Using postgresql
Run options: --seed 48032 -n "/^(?:ViewWithoutPrimaryKeyTest#(?:test_attributes)|HasOneAssociationsTest#(?:test_destroyed_by_association_set_in_child_destroy_callback_on_parent_destroy|test_destroyed_by_association_set_in_child_destroy_callback_on_replace))$/" --verbose

ViewWithoutPrimaryKeyTest#test_attributes = 0.06 s = .
HasOneAssociationsTest#test_destroyed_by_association_set_in_child_destroy_callback_on_parent_destroy = 0.22 s = .
HasOneAssociationsTest#test_destroyed_by_association_set_in_child_destroy_callback_on_replace = 0.02 s = .

Finished in 0.311217s, 9.6396 runs/s, 9.6396 assertions/s.

3 runs, 3 assertions, 0 failures, 0 errors, 0 skips
```
2017-08-06 22:48:30 +00:00
David Heinemeier Hansson
6b0d59895c Merge pull request #30094 from dixpac/change_azure_name_in_storage_yml
Fix wrong service name in the storage.yml
2017-08-06 13:18:52 -05:00
David Heinemeier Hansson
3b564ac6a7 Merge pull request #30099 from bogdanvlviv/set_version_of_active_storage_to_5_2_0_alpha_inside_package_json
Active Storage to 5.2.0.alpha inside `activestorage/package.json`
2017-08-06 13:15:31 -05:00
bogdanvlviv
ee0378b638
Active Storage to 5.2.0.alpha inside activestorage/package.json
Follow #30083
2017-08-06 17:23:07 +00:00
Ryuta Kamizono
22928cea1e Merge pull request #30097 from mgiagante/master
Replaces the 17 for the actual call to params[:id] that would make th…
2017-08-07 01:05:42 +09:00
Mariano Giagante
b1638a8cfa Replaces the 17 for the actual call to params[:id] that would make the code work as intended. [ci skip] 2017-08-06 12:43:57 -03:00
dixpac
0b6a56f62e Fix wrong service name in the storage.yml 2017-08-06 15:28:47 +02:00
Yoshiyuki Hirano
02499892a2 Fix engine command 2017-08-06 21:02:16 +09:00
Vipul A M
1fe55e94b7 Pass over Active Storage readme [ci skip] (#30086) 2017-08-06 13:44:45 +05:30
Ryuta Kamizono
4d4e857256 Merge pull request #30089 from yboulkaid/master
Remove outdated comment [ci skip]
2017-08-06 16:36:51 +09:00
Yoshiyuki Hirano
fc84a198fa Fix escaped character 2017-08-06 15:40:47 +09:00
Youssef Boulkaid
d33bdef821 Remove outdated comment [ci skip]
The comment was describing a previous version of the method with
a different signature. This is outdated since e76c38e
2017-08-06 04:20:16 +02:00
David Heinemeier Hansson
a8217bb594 Merge pull request #30066 from claudiob/ast-module
`module ActiveStorage`, not `ActiveStorage::Class`
2017-08-05 09:11:41 -05:00
David Heinemeier Hansson
616f3611d5 Merge branch 'master' into ast-module 2017-08-05 09:11:02 -05:00
David Heinemeier Hansson
6df24c693e Merge pull request #30068 from kamipo/user_start_with_than_regexp
Use `content_type.start_with?("...")` than `content_type =~ /^.../`
2017-08-05 09:07:38 -05:00
David Heinemeier Hansson
b360f07bd2 Merge pull request #30081 from y-yagi/fix_ruby_warnings
Fix ruby warnings
2017-08-05 09:07:07 -05:00
David Heinemeier Hansson
ea5c99dce1 Merge pull request #30080 from georgeclaghorn/active-storage-secret-key-base
Active Storage: check for `app.secrets.secret_key_base`, not `app.config.secret_key_base`
2017-08-05 09:06:32 -05:00
David Heinemeier Hansson
44da50df17 Merge pull request #30082 from kamipo/add_missing_blank_line
Add missing blank line between `config.active_storage` and `config.action_cable`
2017-08-05 09:05:58 -05:00
David Heinemeier Hansson
1c96ca2d44 Merge pull request #30083 from koic/change_gem_version_of_active_storage_to_5_2_0
Change gem version of Active Storage to 5.2.0.alpha
2017-08-05 09:05:25 -05:00
George Claghorn
1ab1f87596 Check for app.secrets.secret_key_base, not app.config.secret_key_base
By default, apps only have the former set.
2017-08-05 10:03:53 -04:00
David Heinemeier Hansson
354b142647 Merge pull request #30056 from dixpac/remove_unecessary_variable
Remove unnecessary variable
2017-08-05 09:02:17 -05:00
dixpac
2b9e04b6f9 Remove unecesarry exception variable 2017-08-05 14:05:18 +02:00
Matthew Draper
d6b8b8c142 Revert "Merge pull request #15446 from akshay-vishnoi/doc_changes"
It was right as originally written in #15440.
2017-08-05 17:29:48 +09:30
Koichi ITO
10a7ae39c6 Change gem version of Active Storage to 5.2.0.alpha 2017-08-05 14:24:31 +09:00
Ryuta Kamizono
5a6c4c2e52 Add missing blank line between config.active_storage and config.action_cable 2017-08-05 14:01:40 +09:00
yuuji.yaginuma
46db463d06 Fix ruby warnings
This fixes following warnings:

```
test/models/variant_test.rb:11: warning: ambiguous first argument; put parentheses or a space even after `/' operator
lib/active_storage/attached/macros.rb:63: warning: instance variable @active_storage_attached_highlights not initialized
lib/active_storage/attached/macros.rb:25: warning: instance variable @active_storage_attached_avatar not initialized
```
2017-08-05 12:22:39 +09:00