Commit Graph

66225 Commits

Author SHA1 Message Date
fatkodima
08aa8afd24
RedisCacheStore: fix #write_multi mset serialization
Closes #31886
Fixes #31884
2018-02-04 17:16:27 -08:00
yuuji.yaginuma
5d1999547d Make test runner work with AR test tool
Since #29572, test runner will be loaded as minitest's plugin.
Therefore, if specify a value in `Minitest.extensions` before the Minitest
initialization process, the extension will not load and the test runner will
not work.
44eee51ed9/lib/minitest.rb (L86)

Also, load processing of adapter is done before minitest option processing,
so set the adapter in the file so that the `-a` option works.
2018-02-04 20:19:46 +09:00
Ryuta Kamizono
fe595ecf2f Prefer @connection.abandon_results! than @connection.next_result while @connection.more_results? 2018-02-04 14:19:36 +09:00
Ryuta Kamizono
73d1f5f310 Add nodoc to migrations_paths and migration_context in AbstractAdapter
These are internally used only.

[ci skip]
2018-02-04 04:27:18 +09:00
Ryuta Kamizono
883f51c4b8
Merge pull request #31878 from timdiggins/corrections-to-31755
Correct capitalization of "Rails" in guide text

[ci skip]
2018-02-04 03:35:06 +09:00
Tim Diggins
053e3fa1e5 Correct capitalization of "Rails" in the guide text.
correction to #31755 as per https://github.com/rails/rails/pull/31755#discussion_r165819798
2018-02-03 17:35:02 +00:00
Ryuta Kamizono
4d99720fd3
Merge pull request #28171 from sorra/fresh-thread-tagged-logging
Improve test for TaggedLogging "keeps each tag in their own thread"
2018-02-03 22:41:39 +09:00
yuuji.yaginuma
cb9e35ee00 Add nodoc to CredentialsGenerator and MasterKeyGenerator [ci skip]
These classes are internally used only.
2018-02-03 09:06:09 +09:00
Eileen M. Uchitelle
95f9c9bfd6
Merge pull request #31868 from y-yagi/fix-build-failures-on-travis
Fix build failures on Travis
2018-02-02 10:23:57 -05:00
Eileen M. Uchitelle
4df5fa26d8
Merge pull request #31276 from freeletics/fix-generators-list
Removed "private" generators from command list.
2018-02-02 10:17:23 -05:00
Wojciech Wnętrzak
c8dc4f2e41
Removed "private" generators from command list.
Appropriate way to handle encrypted command is by `bin/rails credentials` and
`bin/rails encrypted`

It was displayed on `bin/rails generate` command:
```
Please choose a generator below.

Rails:
  application_record
  assets
  channel
  controller
  encrypted_file
  encryption_key_file
  generator
  ...
```
2018-02-02 10:33:19 +01:00
George Claghorn
74aa62cb69
Merge pull request #31854 from huacnlee/allow-more-options-for-service-url
Allow ActiveStorage::Blob#service_url to pass addition options to service.url
2018-02-01 21:57:09 -05:00
yuuji.yaginuma
dff749eb5d Avoid bundle clean before caching
I'm not sure cause, but due to the influence of `gem clean`, the expected
gem seems not to be installed correctly.
In order to avoid a test failure due to this, I fixed that `gem clean` not be executed.
Ref: https://github.com/travis-ci/travis-ci/issues/2518#issuecomment-121168856

This is a workaround. If Travis fixes something, please revert this.
2018-02-02 09:16:51 +09:00
Ryuta Kamizono
8f2bb58ba2
PERF: Recover marshaling dump/load performance (#31827)
* PERF: Recover marshaling dump/load performance

This performance regression which is described in #30680 was caused by
f0ddf87 due to force materialized `LazyAttributeHash`.

Since 95b86e5, default proc has been removed in the class, so it is no
longer needed that force materialized.

Avoiding force materialized will recover marshaling dump/load
performance.

Benchmark:

https://gist.github.com/blimmer/1360ea51cd3147bae8aeb7c6d09bff17

Before:

```
it took 0.6248569069430232 seconds to unmarshal the objects

Total allocated: 38681544 bytes (530060 objects)

allocated memory by class
-----------------------------------
  12138848  Hash
  10542384  String
   7920000  ActiveModel::Attribute::Uninitialized
   5600000  ActiveModel::Attribute::FromDatabase
   1200000  Foo
    880000  ActiveModel::LazyAttributeHash
    400000  ActiveModel::AttributeSet
        80  Integer
        72  ActiveRecord::ConnectionAdapters::SQLite3Adapter::SQLite3Integer
        40  ActiveModel::Type::String
        40  ActiveRecord::Type::DateTime
        40  Object
        40  Range

allocated objects by class
-----------------------------------
    250052  String
    110000  ActiveModel::Attribute::Uninitialized
     70001  Hash
     70000  ActiveModel::Attribute::FromDatabase
     10000  ActiveModel::AttributeSet
     10000  ActiveModel::LazyAttributeHash
     10000  Foo
         2  Integer
         1  ActiveModel::Type::String
         1  ActiveRecord::ConnectionAdapters::SQLite3Adapter::SQLite3Integer
         1  ActiveRecord::Type::DateTime
         1  Object
         1  Range
```

After:

```
it took 0.1660824950085953 seconds to unmarshal the objects

Total allocated: 13883811 bytes (220090 objects)

allocated memory by class
-----------------------------------
   5743371  String
   4940008  Hash
   1200000  Foo
    880000  ActiveModel::LazyAttributeHash
    720000  Array
    400000  ActiveModel::AttributeSet
        80  ActiveModel::Attribute::FromDatabase
        80  Integer
        72  ActiveRecord::ConnectionAdapters::SQLite3Adapter::SQLite3Integer
        40  ActiveModel::Type::String
        40  ActiveModel::Type::Value
        40  ActiveRecord::Type::DateTime
        40  Object
        40  Range

allocated objects by class
-----------------------------------
    130077  String
     50004  Hash
     10000  ActiveModel::AttributeSet
     10000  ActiveModel::LazyAttributeHash
     10000  Array
     10000  Foo
         2  Integer
         1  ActiveModel::Attribute::FromDatabase
         1  ActiveModel::Type::String
         1  ActiveModel::Type::Value
         1  ActiveRecord::ConnectionAdapters::SQLite3Adapter::SQLite3Integer
         1  ActiveRecord::Type::DateTime
         1  Object
         1  Range
```

Fixes #30680.

* Keep the `@delegate_hash` to avoid to lose any mutations that have been made to the record
2018-02-02 07:52:33 +09:00
Rafael França
2417f3c53f
Merge pull request #31859 from bogdanvlviv/add-changelog-entry-for-31844
Add changelog entry for #31844
2018-02-01 12:10:39 -05:00
Jason Lee
69ae9fe6b5 Allow ActiveStorage::Blob#service_url to pass addition options to service.url.
Because there have some service needs more parameters for file URL:

https://www.alibabacloud.com/help/doc-detail/44687.htm

```rb
class AliyunService < Service
  def url(key, options = {})
    image_process = options[:oss_process] || "image/resize,w_800"
    "http://image-demo.oss-cn-hangzhou.aliyuncs.com/example.jpg?x-oss-process=#{image_process}"
  end
end
```

Use case:

```erb
<%= image_tag @user.avatar.service_url(oss_process: "image/resize,m_fill,h_100,w_100" %>
```
2018-02-01 23:49:25 +08:00
George Claghorn
f687183c30
Merge pull request #31855 from renchap/fix-activestorage-json-coder
ActiveStorage: use the full class name for the JSON coder
2018-02-01 10:02:15 -05:00
bogdanvlviv
88ba705609
Add changelog entry for #31844 2018-02-01 16:47:42 +02:00
Renaud Chaput
eafe2c16cd Use the full class name for the JSON coder, as there may be another
`JSON` constant defined.

For example when using the `representable` gem: https://github.com/trailblazer/representable/issues/224
2018-02-01 11:17:11 +00:00
Ryuta Kamizono
3ab6cbcfc0
Merge pull request #31853 from simi/patch-2
Update to latest rubies (2.2.9, 2.3.8 and 2.4.3) on Travis CI.
2018-02-01 20:02:51 +09:00
Josef Šimánek
0f6b7b5156
Update to latest rubies (2.2.9, 2.3.8 and 2.4.3) on Travis CI. 2018-02-01 11:03:59 +01:00
Ryuta Kamizono
4f0eb1ccd9
Merge pull request #31844 from igorkasyanchuk/add_to_hash_and_to_h_for_session_and_cookies
Consistent behavior for session and cookies with to_h and to_hash method
2018-02-01 08:13:38 +09:00
George Claghorn
57cc6f4030 Correct orientation detection 2018-01-31 16:50:30 -05:00
Igor Kasyanchuk
2587cadd42 Consistent behavior for session and cookies with to_h and to_hash method 2018-01-31 13:36:01 -08:00
George Claghorn
f9b806eaa1 Swap encoded image width and height if angle is 90 or 270 degrees 2018-01-31 15:43:29 -05:00
George Claghorn
148d0077c5 Revert "Merge pull request #31447 from fatkodima/redis_cache-connection_pool"
This reverts commit ac74e2c521f6ddc0eac02d74a1313261bcc1d60f, reversing
changes made to ffdb06136152b3c5f7f4a93ca5928e16e755d228.
2018-01-31 09:49:32 -05:00
Eileen M. Uchitelle
8a05dff9f3
Merge pull request #31838 from bogdanvlviv/fix-value-of-as-attribute-for-link-type-preload
Fix `as` attribute value for preload link
2018-01-31 08:11:15 -05:00
bogdanvlviv
689da12082
Fix as attribute value for preload link
`as` attribute value should be `style` for stylesheet preload link

See https://w3c.github.io/preload/#as-attribute
2018-01-31 13:08:50 +02:00
Yuji Yaginuma
2ea5b8f057 Fix Unknown migration version "6.0" 2018-01-31 15:04:24 +09:00
Yuji Yaginuma
3ba52d6a2b Update default deprecation horizon
Because the master branch is already 6.0.
2018-01-31 14:27:45 +09:00
Arun Agrawal
9709b004b4
Merge pull request #31834 from sotayamashita/fix/typo
Fix typo
2018-01-31 10:50:55 +05:30
Yuji Yaginuma
71a392c465 Fix RuntimeError: Unknown version "6.0" 2018-01-31 14:14:56 +09:00
Sam Yamashita
ac3df40995 Fix typo 2018-01-31 13:52:56 +09:00
Rafael Mendonça França
1c383df324 Start Rails 6.0 development!!!
🎉🎉🎉
2018-01-30 18:51:17 -05:00
Rafael França
bec74e1d4a
Merge pull request #31830 from rafaelfranca/disable-csp-by-default
Disable CSP by default
2018-01-30 18:30:13 -05:00
George Claghorn
54bb2f74b5 Add Rack::TempfileReaper to tests and docs 2018-01-30 18:21:07 -05:00
George Claghorn
cdffab4bc7 Add Rack::TempfileReaper to the default middleware stack 2018-01-30 18:13:13 -05:00
Rafael Mendonça França
39c4a5c40b Disable CSP by default
Before this patch, to be able to use webpacker and webconsole we were
defining an used default in the script-src policy. White we don't
implement the automatic nonce approach defined in
https://github.com/rails/rails/issues/31689 it is better to not have any
default configuration in Rails 5.2.
2018-01-30 17:50:32 -05:00
Claudio B
889eb91d5f
Merge pull request #31828 from claudiob/doc-csp
Add ContentSecurityPolicy to list of middleware
2018-01-30 08:27:41 -08:00
claudiob
5ea2d0224f Add ContentSecurityPolicy to list of middleware
Document in the guides the new middleware added in #31162
[ci skip]
2018-01-30 08:20:58 -08:00
Ryuta Kamizono
0c98d06a5e Remove unused require "active_record/tasks/database_tasks" 2018-01-30 11:31:39 +09:00
George Claghorn
cad433a9c8
Merge pull request #31826 from miketheman/patch-1
Update rails-ujs readme
2018-01-29 21:02:52 -05:00
George Claghorn
8ef0751b12
Merge pull request #31815 from composerinteralia/make-request-id
Allow @ in X-Request-Id header
2018-01-29 20:45:02 -05:00
Matthew Draper
44fc16c284 Merge pull request #31769 from justjake/patch-2
yarnpkg: correct exec syntax
2018-01-30 11:57:32 +10:30
Ryuta Kamizono
393d497a53 Don't expose attributes_with_uninitialized_key utility method
It is not a test case.
2018-01-30 10:16:05 +09:00
Daniel Colson
eea28f4103 Allow @ in X-Request-Id header
It makes sense to be as strict as possible
with headers from the outside world,
but allowing @ to support Apache's mod_unique_id
(see #31644) seems OK to me
2018-01-29 19:35:39 -05:00
Mike Fiedler
0ae2476acd
Update rails-ujs readme
Link to W3C reference was broken, this uses the latest URL, along with HTTPS.
2018-01-29 19:18:35 -05:00
Rafael França
4734812ec5
Merge pull request #31814 from fatkodima/index-nulls-order
Dump correctly index nulls order for PostgreSQL
2018-01-29 18:48:35 -05:00
George Claghorn
ca1d13a158
Merge pull request #31821 from composerinteralia/extra-to_s
Avoid extra calls to to_s
2018-01-29 15:56:53 -05:00
Eileen M. Uchitelle
ef83c41724
Merge pull request #31825 from mistydemeo/fix_post_documentation
ActionController::TestCase: fix #post documentation
2018-01-29 14:00:48 -05:00