Commit Graph

66225 Commits

Author SHA1 Message Date
Ryuta Kamizono
192e74fc60 Don't need to pass manager to convert_join_strings_to_ast
Because `Relation` already have Arel `table`.
2018-01-14 07:31:38 +09:00
Ryuta Kamizono
e9c16536d4 Don't pass garbage args to alias tracker
This is a complete fix to #30995.

Originally alias tracker will only track table aliases on
`Arel::Nodes::Join`, other args are ignored.

Since c5ab6e5, parent aliases hash will be passed then it caused the
regression #30995.

It is enough to pass list of `Arel::Nodes::Join` simply, not need to
pass garbage args which will be ignored.
2018-01-14 06:50:25 +09:00
Yuji Yaginuma
0c743885ba
Merge pull request #31572 from kami-zh/fix-template
Fix comment about initializers to adapt to the fact
2018-01-13 14:50:43 +09:00
Ryuta Kamizono
1a4eb55a82 deep_dup is used in AttributeSet#deep_dup 2018-01-13 13:09:31 +09:00
Sean Griffin
f8afb5168a
Merge pull request #31651 from eugeneius/use_sha1_digests
Use SHA-1 for non-sensitive digests by default
2018-01-12 15:03:32 -07:00
Rafael França
aa0541e686
Merge pull request #31695 from tcopeland/fix_typo
Fix doc typo [ci-skip]
2018-01-12 16:06:29 -05:00
Tom Copeland
4f9f68e7a6 Fix doc typo [ci-skip] 2018-01-12 16:02:09 -05:00
Eileen M. Uchitelle
604ef72067
Merge pull request #31675 from Dorian/fix-some-broken-links-in-guides
Fix some broken links in guides
2018-01-12 15:05:42 -05:00
David Heinemeier Hansson
0f7d3b612c Use unsafe_inline as the default for script_src CSP until we get a nonce alternative
Closes #31273 but we will still want to upgrade this to the
nonce-approach when it’s ready.
2018-01-12 15:35:22 +01:00
David Heinemeier Hansson
9a023c83ca Add note about having to restart when modifying initializer 2018-01-12 15:21:27 +01:00
David Heinemeier Hansson
4697b19b88 Use complete variable names rather than single-letter abbreviations for style 2018-01-12 15:07:32 +01:00
Matthew Draper
3387676efd
Merge pull request #31682 from jameslovejoy/fix-rdoc-typos-documentation
Fix typos, update documentation
2018-01-12 16:00:37 +10:30
James Lovejoy
49542ae886 Fix typos, update documentation
[ci skip]
2018-01-11 17:10:06 -08:00
Rafael Mendonça França
c09ebcf4a9 Use my fork instead of an thrid-party fork
This will avoid the branch being deleted by mistake making all builds to
fail.
2018-01-11 14:37:27 -05:00
Rafael Mendonça França
181836d894 Merge pull request #31671 from larskanis/pg-1.0
PostgreSQL: Allow pg-1.0 gem to be used with ActiveRecord
2018-01-11 14:31:37 -05:00
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
Lars Kanis
13eff51b1b PostgreSQL: Update Gemfile to pg-1.0.0
Queue_classic currently limits pg to "< 0.20".
It is therefore not used for rails CI tests. There has been
a bull request for a while (by a co-worker of mine), which
fixes the incompatibilities and extends dependencies to pg-1.x.

This patch add this pull request to the Gemfile as an interim
solution, until it is merged.
2018-01-10 21:55:43 +01:00
Lars Kanis
f820dc2dea PostgreSQL: Allow pg-1.0 gem to be used with ActiveRecord
pg-1.0.0 is just released and most Gemfiles don't restrict
it's version. But the version is checked when connecting to
the database, which leads to the following error:

Gem::LoadError: can't activate pg (~> 0.18), already activated pg-1.0.0

See also this pg issue:
https://bitbucket.org/ged/ruby-pg/issues/270/pg-100-x64-mingw32-rails-server-not-start

Preparation for pg-1.0 was done in commit f28a331023fab,
but the pg version constraint was not yet relaxed.
2018-01-10 21:55:43 +01: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
Christof Koenig
c33f47df67 Work on a dup'ed options hash
Otherwise, at least using JRuby, the replacements in
convert_database_option_for_jruby won't work. Thus a call to

    bundle exec rails app:update

fails. Simply replacing those replace statements doesn't seem to work
either, since the options hash seems to be frozen, too.
2018-01-09 09:13:52 +01: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