Commit Graph

66272 Commits

Author SHA1 Message Date
Yauheni Dakuka
27e5c76a77 Remove parentheses [ci skip] 2018-02-12 09:31:24 +03:00
George Claghorn
cfcb92f9ea Add missing require 2018-02-11 18:30:09 -05:00
Yuji Yaginuma
360d9bdbf3
Merge pull request #31957 from claudiob/force-master-key
Respect --force option for config/master.key
2018-02-12 07:49:37 +09:00
claudiob
24284fd3d4 Respect --force option for config/master.key
This is similar to #30700 which ensures the `--quiet` option of `rails new`
is respected by the `MasterKeyGenerator` (missing from #30067).

Before this commit, running `rails new app --force` would still prompt the
user what to do with the conflict in `config/master.key`:

```
              …
   identical  config/locales/en.yml
    conflict  config/master.key
Overwrite /Users/claudiob/Desktop/pizza/config/master.key? (enter "h" for help) [Ynaqdh]
```

After this commit, `config/master.key` is overwritten:

```
           …
identical  config/locales/en.yml
    force  config/master.key
   append  .gitignore
```

The newly added test generates an app and then generates it again with
`--force`. Without this commit, the test would just wait forever for user
input.
2018-02-11 11:37:21 -08:00
Matthew Draper
a2a752d102
Merge pull request #31133 from mohsen-alizadeh/sanitize_empty_and_nil_parameters_passed_to_select
sanitize empty and nil parameters to select #31059
2018-02-11 19:37:10 +10:30
Akira Matsuda
d0192e0c2d Unused core_ext 2018-02-11 02:19:50 +09:00
Claudio B
936a96a98b
Merge pull request #31949 from rails/remove-move
Remove warning from 4 years ago [ci skip]
2018-02-09 16:55:05 -08:00
claudiob
4491ce902b Remove warning from 4 years ago [ci skip]
`config/initializers/assets.rb` has been a part of Rails apps since
Rails 4.2 (30b56084). This comment is probably unnecessary by now.
2018-02-09 16:49:38 -08:00
yuuji.yaginuma
b91a4a0826 Fix formatting of pick [ci skip] 2018-02-10 09:01:03 +09:00
Rafael Mendonça França
c92ea62792 Make sure assert_recognizes can still find routes mounted after engines
Before, if the application defined after an engine this method would not
recognize the route since it was not defined insdie the engine.
2018-02-09 13:51:20 -05:00
David Heinemeier Hansson
80cc0d323b
Add Relation#pick as short-hand for single-value plucks (#31941)
* Add Relation#pick as short-hand for single-value plucks
2018-02-09 10:30:19 -08:00
Eileen M. Uchitelle
b6ee4e4b98
Merge pull request #31927 from mrreynolds/patch-2
Document :combine_options
2018-02-09 09:18:11 -05:00
Yuji Yaginuma
172c80dfd9
Merge pull request #31942 from yhirano55/use_heredoc_with_credentials_template
Use heredoc with credentials template
2018-02-09 16:59:45 +09:00
Yoshiyuki Hirano
1469657349 Use heredoc with credentials template
* Use heredoc with credentials template.
* Fix indentation for aws config
2018-02-09 15:38:44 +09:00
Ryuta Kamizono
52c9af6c51 Merge pull request #31934 from fatkodima/fix-has_many_through-dumping
Fix marshaling of models with `has_many :through` associations
2018-02-09 09:53:35 +09:00
Ryuta Kamizono
0613533f78
Merge pull request #31919 from bogdanvlviv/fix-test_counter_cache_with_touch_and_lock_version
Fix `test_counter_cache_with_touch_and_lock_version` failure
2018-02-09 09:43:34 +09:00
Robert Glaser
6ee504b1d7 Document :combine_options
Turns out this is still undocumented functionality.
2018-02-08 21:54:29 +01:00
fatkodima
42a3c92c8c Fix marshaling of models with has_many :through associations 2018-02-08 16:13:56 +02:00
Eileen M. Uchitelle
d7f9adf794
Merge pull request #31925 from composerinteralia/semicolon
Fix grammar bug in security guide [ci skip]
2018-02-08 08:37:19 -05:00
claudiob
cc488b40d2 Add docs on how to configure Active Storage
[ci skip]
2018-02-08 08:09:56 -05:00
yuuji.yaginuma
e4719ec047 Add missing require
Without this require, an error occurs when executing only `duration_test.rb`.
Ref: https://travis-ci.org/rails/rails/jobs/338817558#L2205-L2210
2018-02-08 20:05:48 +09:00
Yuji Yaginuma
5d75ef72e6
Do not add master key when RAILS_MASTER_KEY env specified (#31922)
Fixes #31917
2018-02-08 19:49:50 +09:00
George Claghorn
cc523fba9b
Merge pull request #31918 from huacnlee/fix/blob-service-url-for-string-filename
Fix `blob.service_url` for supports string type `:filename` option
2018-02-07 22:31:32 -05:00
Jason Lee
0625a2ba80 Fix blob.service_url for supports string or nil :filename option.
- Make sure `blob.service_url` present a `ActiveStorage::Filename` type to `serivce.url`.
- Add `ActiveStorage::Filename.wrap` method.

before:

```rb
blob.service_url(filename: ActiveStorage::Filename.new("new.txt"))

blob.service_url(filename: "new.txt")
=> NoMethodError: undefined method `parameters' for "new.txt":String

params = {}
blob.service_url(filename: params[:filename])
=> NoMethodError: undefined method `parameters' for nil:NilClass
```

after:

```rb
blob.service_url(filename: "new.txt")
blob.service_url(filename: nil)
```
2018-02-08 10:15:55 +08:00
Daniel Colson
013fd84373 Remove password anecdotes from guides [ci skip] 2018-02-07 18:00:10 -05:00
bogdanvlviv
4444294cd9
Fix test_counter_cache_with_touch_and_lock_version failure
https://travis-ci.org/rails/rails/jobs/338338927#L1043

Related to daf15f58b943d85d8fb726590ae94f77ca0a5d5f
2018-02-07 23:23:19 +02:00
Rafael França
5ae2ecab6d
Merge pull request #31923 from jdelStrother/duration-deserialization
Fix yaml deserialization of ActiveSupport::Duration
2018-02-07 15:06:21 -05:00
Jonathan del Strother
a467c6bdd5 Fix yaml deserialization of ActiveSupport::Duration
This ensures the duration's @parts hash has a default value, to avoid this regression introduced in 5.1:

  YAML.load(YAML.dump(10.minutes)) + 1  # => NoMethodError: undefined method `+' for nil:NilClass
2018-02-07 13:19:08 +00:00
yuuji.yaginuma
c5d431e469 Bump minitest-server
In order to use `minitest_bisect` with Minitest 5.11.x, it needs to be
updated.
Ref: https://github.com/seattlerb/minitest-server/issues/2
2018-02-07 21:47:48 +09:00
Ryuta Kamizono
01c54e29bd Revert "✂️"
This reverts commit 487a1061cc496455dfe5ee84d1e49d509c1675b5.

This `#--` is necessary for the doc of `distinct`.

[ci skip]
2018-02-07 14:49:24 +09:00
schneems
487a1061cc ✂️ 2018-02-06 22:28:05 -06:00
Matthew Draper
7a1fa2c584
Merge pull request #31914 from utilum/bump_em-socksify
Update em-socksify to the latest version
2018-02-07 11:25:06 +10:30
Matthew Draper
8c4f9a61d6
Merge pull request #31912 from robin850/upgrade-sdoc-1-0
Refer to a stable release of SDoc
2018-02-07 11:20:30 +10:30
utilum
64be732b1a Update em-socksify to the latest version
Avoid warning: parentheses after method name is interpreted as an argument list, not a decomposed argument
2018-02-06 23:08:13 +01:00
Robin Dupret
38d2b473c2 Refer to a stable release of SDoc 2018-02-06 19:49:15 +01:00
Javan Makhmali
d57c52a385
Merge pull request #31880 from rmacklin/publish-activestorage-source-in-addition-to-compiled-js
Include source code in published activestorage npm package
2018-02-06 12:09:08 -05:00
Richard Macklin
c0368ad090 Include source code in published activestorage npm package
This allows activestorage users to ship smaller javascript bundles to
visitors using modern browsers, as demonstrated in this repository:
https://github.com/rmacklin/activestorage-es2015-build-example

In that example, the bundle shrinks by 5K (24%).

In addition to allowing smaller bundles for those who ship untranspiled
code to modern browsers, including the source code in the published
package can be useful in other ways:

1. Users can import individual modules rather than the whole library
2. As a result of (1), users can also monkey patch parts of
   activestorage by importing the relevant module, modifying the
   exported object, and then importing the rest of activestorage (which
   would then use the patched object).

Note:
In order to allow the source code to be depended on rather than the
compiled code, we have to declare the external dependency on spark-md5
as a regular dependency, not a development dependency.

This means that even users who depend on the compiled code will have to
download this package. However, spark-md5 is a small package, so this
tradeoff seems worth it.
2018-02-06 08:18:21 -08:00
Eileen M. Uchitelle
f76c7e860e
Merge pull request #31240 from PHedkvist/sys_test_mobile_guide
Example of multiple configurations for system test in guide [ci skip]
2018-02-06 10:03:38 -05:00
Ryuta Kamizono
06d04bc237 Invoke load_schema in _default_attributes
Currently `_default_attributes` doesn't work unless `load_schema` is
called before.

The `MissingAttributeError` is caused by `reload_schema_from_cache` is
invoked by `serialize`.

I added `load_schema` in `_default_attributes` to `_default_attributes`
works without any dependency like `attribute_types` etc.

Closes #31905.
2018-02-06 22:32:03 +09:00
fatkodima
83c1ed9a1a Use Redis#mget for RedisCacheStore#fetch_multi 2018-02-05 13:51:55 -08:00
fatkodima
3b5d940fe5 Add missing instrumentation to RedisCacheStore#read_multi 2018-02-05 11:57:14 -08:00
eileencodes
1dfc3a248a Don't output information on drop if not verbose
Followup to b988ecb, when I cherry-picked from my parallel testing
branch I didn't realize `drop` wasn't part of the commit.
2018-02-05 13:38:13 -05:00
eileencodes
b988ecb99f Add ability to turn off verbose for database tasks
You could use the `VERBOSE` env var to turn off output for migrations
tasks but you couldn't use it for other tasks.

This change moves the `verbose?` check to a method so we can also use it
in create and drop respectively.

tenderlove and I noticed this as part of the ongoing work in parallel
testing. When the parallel tests boot the app needs to create new
databases for each worker. The output from these is unnecessary but
there was previously no way to turn it off. Now if `VERBOSE=false` is
passes to `bin/rails db:create` the text "Created blah blah db" will no
longer be output.
2018-02-05 13:35:05 -05:00
Jeremy Daer
f9a8646d81
Redis cache store: consolidate serialization
Use `serialize_entry` throughout and introduce `serialize_entries`.
2018-02-04 23:03:59 -08:00
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