Commit Graph

65996 Commits

Author SHA1 Message Date
Dorian Marié
e17b5fd572 Fix some broken links in guides 2018-01-11 15:53:20 +01:00
Eileen M. Uchitelle
5e8c79a6fa
Merge pull request #31653 from ydakuka/fix-typo-0801
Fix typos [ci skip]
2018-01-11 08:47:14 -05:00
George Claghorn
2c08446e0c Instrument image transformation 2018-01-10 21:50:14 -05:00
George Claghorn
c69c7b3690 Instrument preview image drawing 2018-01-10 21:48:53 -05:00
Ryuta Kamizono
2a934aa3c9 Merge pull request #30268 from ignatiusreza/instrumentation
add instrumentation for read_multi
2018-01-11 09:14:56 +09:00
Aaron Patterson
013a8abd48
Merge pull request #31624 from y-yagi/fix_minitest_511
Add support for Minitest 5.11
2018-01-10 15:46:29 -08:00
Ryuta Kamizono
ae48c65e41 Merge pull request #23146 from piotrj/issue_18424
When deleting through records, take into account association conditions
2018-01-11 07:31:05 +09:00
Yauheni Dakuka
0ce7681686 Fix typos [ci skip] 2018-01-11 00:56:35 +03:00
Ryuta Kamizono
f30f20ccec Remove the deprecated :conditions option in INVALID_AUTOMATIC_INVERSE_OPTIONS
This option was moved into active_record_deprecated_finders in ac4d101.
2018-01-11 05:59:59 +09:00
Ryuta Kamizono
412db710df Use apply_join_dependency instead of meaningless named find_with_associations
`find_with_associations` is meaningless name in this point since it just
contain `construct_join_dependency` and `apply_join_dependency`, does
not contain finding anything.
If `apply_join_dependency` returns `relation` and `join_dependency` then
`find_with_associations` is no longer needed.
2018-01-11 04:28:28 +09:00
Ryuta Kamizono
b4f64cb159 Make relation.exists? more performant when using eager loading
`relation.exists?` just wants to know if there is a result or not, does
not need the exact records matched. Therefore, an intermediate SELECT
query for eager loading is not necessary.
2018-01-11 03:29:50 +09:00
George Claghorn
96f5930610 Update error names in docs [ci skip] 2018-01-10 12:37:07 -05:00
Ryuta Kamizono
7e78d2cc94 Add missing # frozen_string_literal: true 2018-01-11 02:33:41 +09:00
Ryuta Kamizono
e81f20702a Merge pull request #31446 from bdewater/inverse-of-options-docs
Fix :inverse_of documentation
2018-01-11 02:25:38 +09:00
George Claghorn
3320e80b93 Correct comment [ci skip] 2018-01-10 12:15:30 -05:00
George Claghorn
d4cdd4a05f Extract Analyzable and Representable concerns 2018-01-10 12:12:04 -05:00
Bart de Water
4ab4364a51 [ci skip] setting :inverse_of works with :as, :through and :polymorphic options, and is needed for bi-directionality with a scope
[ci skip] Remove :conditions opion from association basics guide

This got replaced by scopes.
2018-01-10 11:59:24 -05:00
Ryuta Kamizono
5a593486f5 Fix stale_state for nested has_many :through associations
Need reloading when through record has replaced.
2018-01-10 22:20:14 +09:00
Yuji Yaginuma
e97221a32d
Merge pull request #31667 from bogdanvlviv/clean-up-railties-tests
Clean up railties tests
2018-01-10 20:38:55 +09:00
Ryuta Kamizono
027f865fc8 Merge pull request #16314 from zoltankiss/allow-nested-has-many-associations-on-unpersisted-parent-instances
fix nested `has many :through` associations on unpersisted parent instances
2018-01-10 20:28:37 +09:00
bogdanvlviv
b6ed9a7f01
Clean up railties tests
Remove `AppGeneratorTest#test_active_storage_install`.
  The test is added by 67db41aa7f17c2d34eb5a914ac7a6b2574930ff4,
  since #31534 this test doesn't test anything.

  Remove redundant assertions in `SharedGeneratorTests`.
  These assertions is added by 4a835aa3236eedb135ccf8b59ed3c03e040b8b01.
  Follows 67db41aa7f17c2d34eb5a914ac7a6b2574930ff4, #31534.
2018-01-10 13:05:01 +02:00
Ryuta Kamizono
7ccd070c91 Fix "the the " [ci skip] 2018-01-10 09:57:37 +09:00
Ryuta Kamizono
b8e5d4f9df Bring back passing single record support for Preloader
I removed redundant `Array.wrap(records)` since `Preloader` is nodoc
class and Active Record always pass `records` as an array to
`Preloader`.
But if users relies on that behavior, it is not worth dropping its
behavior.

Fixes #31661.
2018-01-10 07:08:42 +09:00
Ryuta Kamizono
d749b5d0e8
Merge pull request #29685 from ayanko/fix-slow-name-error-missing-name
Fix performance issue with NameError#missing_name on ruby >= v2.3.0.
2018-01-10 06:01:56 +09:00
Ryuta Kamizono
d7d6921540
Merge pull request #27597 from brchristian/first_last_parity
Consistency between first() and last() with limit
2018-01-10 04:59:33 +09:00
Kasper Timm Hansen
33721a71e3
Merge pull request #31534 from claudiob/kaspth-approach
Don't include Active Storage migrations in new apps
2018-01-09 20:59:04 +01:00
Brian Christian
b75a67cdef resolve inconsistencies between first and to_a.first with limit 2018-01-09 11:28:30 -08:00
George Claghorn
baa88b8ddf
Merge pull request #31652 from kami-zh/activestorage-callbacks
Change Active Storage destroy callbacks
2018-01-09 10:02:22 -05:00
kami-zh
9431529011 Change Active Storage destroy callbacks
There is concern that only blob are deleted depending on
the `before_destroy` definition order which throws abort.
2018-01-09 22:47:02 +09:00
Guillermo Iguaran
428939be9f Add 'Referrer-Policy' header to default headers set 2018-01-08 22:14:22 -05:00
Javan Makhmali
f17137b0a1 Rebuild activestorage.js
To pick up 21417e02e906f6b64f013aafefdc0cb8ea8b5e74
2018-01-08 17:13:18 -05:00
Javan Makhmali
21417e02e9 Work around Firefox's refusal to dispatch events on disabled elements. Fixes #31393
Brought to you by a 12 year old Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=329509
2018-01-08 17:07:32 -05:00
George Claghorn
93e6a0ec55 Fix attaching blobs to optimistically-locked records
Explicitly declare inverse associations so ActiveStorage::Attachment touches the original record instance.

Closes #31542.
2018-01-08 14:34:03 -05:00
George Claghorn
edcd32edad
Merge pull request #31650 from rosa/master
Allow overriding filename in `Blob#service_url`
2018-01-08 10:35:05 -05:00
Rosa Gutierrez
8f52d93576
Allow overriding filename in Blob#service_url
This is useful when we have several representations for the same
underlying file, each one with a different name, and we need to provide
a custom download URL based on that name and not that of the underlying
file.
2018-01-08 15:44:14 +01:00
Ryuta Kamizono
7c69351277 Merge pull request #31648 from dixitp012/rubocop_active_support_test
Fix rubocop space before comma
2018-01-08 15:14:14 +09:00
Dixit Patel
0699a3df9a Fix rubocop space before comma 2018-01-08 10:20:35 +05:30
yuuji.yaginuma
7a0fe78d08 Remove meaningless check
`ActiveSupport::OrderedOptions` responds to any message.
2018-01-08 12:25:24 +09:00
Yuji Yaginuma
bd79c651e0
Merge pull request #31547 from eugeneius/use_authenticated_message_encryption_new_framework_defaults
Allow use_authenticated_message_encryption to be set in new_framework_defaults_5_2.rb
2018-01-08 12:16:53 +09:00
Eugene Kenny
d2113777a1 Allow use_authenticated_message_encryption to be set in new_framework_defaults_5_2.rb
Enabling this option in new_framework_defaults_5_2.rb didn't work
before, as railtie initializers run before application initializers.

Using `respond_to?` to decide whether to set the option wasn't working
either, as `ActiveSupport::OrderedOptions` responds to any message.
2018-01-07 20:13:58 +00:00
Prathamesh Sonpatki
1ba8412607
Fix the desc for image_alt change [ci skip] 2018-01-07 22:29:13 +05:30
Prathamesh Sonpatki
d14029c117
Added deprecation and removal notes for Action View [ci skip] 2018-01-07 22:07:17 +05:30
Prathamesh Sonpatki
1bb99ae7ad
Added deprecations and removals notes for Action Pack [ci skip] 2018-01-07 21:51:51 +05:30
Prathamesh Sonpatki
4d94b1de16
Added release notes for Action Cable [ci skip] 2018-01-07 21:46:00 +05:30
Eileen M. Uchitelle
3b57bf2273
Merge pull request #31610 from prathamesh-sonpatki/improve-deprecation-msg-pr-29358
Improve the deprecation message for using subclass of Rails::Application to start the Rails server
2018-01-07 11:03:53 -05:00
Ryuta Kamizono
f614c5f108 Fix deleting through records when using has_many through with source_type
Currently deleting through records doesn't respect `source_type`. It
should not be ignored in that case.

Related #23209.
Fixes #24116.
2018-01-08 00:58:25 +09:00
Prathamesh Sonpatki
b821f95403
Improve the deprecation message for using subclass of Rails::Application to start the Rails server 2018-01-07 20:48:53 +05:30
George Claghorn
a736e82170 Document automatic width-height swapping [ci skip] 2018-01-07 10:04:14 -05:00
George Claghorn
19185c4dea Remove redundant sentences [ci skip] 2018-01-07 09:56:45 -05:00
Ryuta Kamizono
455456437c Simply use scope.delete_all instead of constructing delete manager 2018-01-07 23:22:20 +09:00