Commit Graph

71548 Commits

Author SHA1 Message Date
yuuji.yaginuma
5df737b7e8 Enable Lint/DeprecatedClassMethods cop to avoid using deprecated methods 2019-01-09 12:00:08 +09:00
Kasper Timm Hansen
ee3ebc9098
Merge pull request #34894 from hahmed/tames-params-wrapper-errors
Capture parsing errors only for ActionController::ParamsWrapper#process_actions
2019-01-09 01:30:28 +01:00
Yuji Yaginuma
b03d493cf6
Merge pull request #34885 from y-yagi/fixes_34780
Allow using combine the Cache-Control `public` and `no-cache` headers
2019-01-09 07:59:16 +09:00
Marco Costa
d79366b4c9 Preserve Bundle configuration during app generation (#34755)
When generating a new rails application (rails new) using a custom template that
includes gems from an authenticated source, the user has to provide credentials to
bundler.

One way to do this is by exporting environment variables, for example:

export BUNDLE_GITHUB__COM=user:pass: provides credentials for bundler to fetch
gems from github.com.

The problem this PR addresses is that we are currently scrubs all /BUNDLE_.*/
environment variables by wrapping our system calls in Bundler.with_clean_env.

We do this because we don't want our commands executed against the generated project
to use the generator's bundler environment (e.g. our gems): the generated project should
use it's own configuration.

The problem with Bundler.with_clean_env is that, on top of restoring environment
variables to their original state, it also scrubs any /BUNDLE_.*/ variables, which is harmful for authenticated gem sources.

This PR replaces Bundler.with_clean_env with Bundler.with_original_env, which only
restores environment variables to their initial state, without additional scrubbing.
2019-01-09 07:52:06 +09:00
Haroon Ahmed
a37cf8d383 Capture parsing errors for ActionController::ParamsWrapper#process_action 2019-01-08 21:52:56 +00:00
Kasper Timm Hansen
80c7038bbc
Revert "Merge pull request #34387 from yhirano55/rails_info_properties_json"
We had a discussion on the Core team and we don't want to expose this information
as a JSON endpoint and not by default.

It doesn't make sense to expose this JSON locally and this controller is only
accessible in dev, so the proposed access from a production app seems off.

This reverts commit 8eaffe7e89719ac62ff29c2e4208cfbeb1cd1c38, reversing
changes made to 133e0ba33db5887b047c9ac8233e5b414657bca5.
2019-01-08 22:21:20 +01:00
Kasper Timm Hansen
647d7e6167
Revert "Revert "Merge pull request #34387 from yhirano55/rails_info_properties_json""
I reverted the wrong commit. Damn it.

This reverts commit f66a977fc7ae30d2a07124ad91924c4ee638a703.
2019-01-08 22:19:22 +01:00
Kasper Timm Hansen
f66a977fc7
Revert "Merge pull request #34387 from yhirano55/rails_info_properties_json"
We had a discussion on the Core team and we don't want to expose this information
as a JSON endpoint and not by default.

It doesn't make sense to expose this JSON locally and this controller is only
accessible in dev, so the proposed access from a production app seems off.

This reverts commit 8eaffe7e89719ac62ff29c2e4208cfbeb1cd1c38, reversing
changes made to b6e4305c3bca4c673996d0af9db0f4cfbf50215e.
2019-01-08 22:16:58 +01:00
Kasper Timm Hansen
842bc43f7f
The frameworks list is order dependent.
Ref: d507f332a9
2019-01-08 21:45:38 +01:00
Rafael França
48375319da
Merge pull request #34890 from rosa/test-exceptions-with-all-adapters
Run exception tests for all ActiveJob adapters and fix issue with individual counters and Resque
2019-01-08 14:17:04 -05:00
Rafael França
1858614219
Merge pull request #34132 from ConfusedVorlon/enable_fragment_cache_log_in_dev
enable_fragment_cache_logging in dev by default
2019-01-08 14:15:16 -05:00
Aaron Patterson
ae4f7b4a0a
Merge pull request #34898 from ksolo/update-raketasks-for-new-frameworks
Add new frameworks to `tasks/release.rb`
2019-01-08 10:47:24 -08:00
Kevin Solorio
ce90ded4ca add new frameworks to tasks/release.rb
The Frameworks collection was missing actiontext and actionmailbox,
this would mean they are skipped when running any tasks that
iterated through this collection

changes include

Breaking up frameworks declaration into multiple lines and put
them in order. This should make adding to the list easier and
if you need to scan it, they will be in order you would expect

Add `package` task to both actiontext and actionmailbox
2019-01-08 10:36:33 -08:00
Rosa Gutierrez
acbbd4ab8d Ensure 0 is always the default for the individual exception counters in ActiveJob
Some adapters like Resque that use Redis, convert the Ruby hash with a
default value, Hash.new(0), into a regular hash without a default value
after serializing, storing and deserializing. This raises an error when
we try to access a missing exception key. A simple solution is not to
rely on the hash's default value, and provide a default as alternative
when accessing it instead.
2019-01-08 12:08:06 +01:00
Rosa Gutierrez
154057b4f7 Rewrite ActiveJob exception tests so it runs with the real adapters
Previously, by extending ActiveJob::TestCase, the test adapter provided
for tests was being used always, in all executions where supposedly
different adapters were being used. As a consequence, some bugs visible
only for some adapters might have gone undetected. This commit changes
that, skipping queue adapters for which we can't test scheduling jobs
with a delay.
2019-01-08 12:07:38 +01:00
Ryuta Kamizono
7f856c3c8d Consolidate the duplicated code that building range predicate
This slightly change the code in the Arel to allow +/-INFINITY as open
ended since the Active Record expects that behavior. See 5ecbeda.
2019-01-08 16:45:17 +09:00
Ryuta Kamizono
a75dea0822
Merge pull request #34896 from bannzai/fix/active_record/mysql/enum_type_map
Allow space for mysql enum and set keyword.
2019-01-08 15:43:52 +09:00
bannzai
45cfe9f8b6 ♻️ Fix mysql type map for enum and set 2019-01-08 14:56:46 +09:00
George Claghorn
29bb990f97 Add load hook for ActionText::RichText 2019-01-07 17:04:58 -05:00
Rafael França
cd16413ef3
Merge pull request #34700 from gmcgibbon/fetch_multi_key_order
Preserve key order of #fetch_multi
2019-01-07 13:49:02 -05:00
George Claghorn
9cfcc067e6
Merge pull request #34886 from lsylvester/attachments-for-actionmailbox
add attachments to the new inbound mail
2019-01-06 20:09:51 -05:00
Lachlan Sylvester
0419bc3504 add attachments to the new inbound mail 2019-01-07 10:56:41 +11:00
yuuji.yaginuma
c1dd228579 Allow using combine the Cache-Control public and no-cache headers
Since #30367, if `no-cache` includes Cache-Control headers, special keys
like `public`, `must-revalidate` are ignored.
But in my understanding, `public` still need in case of want to cache
authenticated pages.
The authenticated pages to be cacheable, but still authenticated for
every user, need to specify the `Cache-Control: public, no-cache`.

For keys other than `public`, I did not know the case where it was
necessary to use it in combination with `no-cache`, so I fixed that can
be used only for `public`.

Ref: https://www.mnot.net/cache_docs/#CACHE-CONTROL

Fixes #34780.
2019-01-07 07:52:29 +09:00
Guillermo Iguaran
1e09019088
Merge pull request #34882 from bogdanvlviv/revert-129f8ac6ff
Revert "Remove node_modules path from assets load paths since we use webpack by default"
2019-01-05 18:29:55 -05:00
bogdanvlviv
814b3cbdea
Revert "Remove node_modules path from assets load paths since we use webpack by default"
This reverts commit 129f8ac6ffcafb2e6e13c9ef13dda4cc47f5af0d.

See 02d2958b6c (commitcomment-31849196)
2019-01-06 01:07:36 +02:00
George Claghorn
02d2958b6c Reset ActionText::Content.renderer before and after each request 2019-01-05 16:59:54 -05:00
George Claghorn
f99b3c5f97
Merge pull request #34865 from cbandy/node_rails_env
Respect Rails.env when running `rails yarn:install`
2019-01-05 12:04:56 -05:00
George Claghorn
a4c0157312
Merge pull request #34878 from bogdanvlviv/action_text-guides-docs
Add Action Text to guides [ci skip]
2019-01-05 11:04:21 -05:00
George Claghorn
20f1f22a78
Merge pull request #34879 from bogdanvlviv/add-skip-action-text-option-to-rails-new-cmd
Add `--skip-action-text` option to `rails new`
2019-01-05 10:42:47 -05:00
George Claghorn
9035000241
Merge pull request #34877 from bogdanvlviv/document-action_text_content-hook
Add `action_text_content` hook to the guide [ci skip]
2019-01-05 10:42:01 -05:00
George Claghorn
7a88f649da
Merge pull request #34875 from bogdanvlviv/test-actiontext-on-rails-6.0
Test actiontext on Rails 6.0
2019-01-05 10:41:41 -05:00
George Claghorn
35ed21bc16
Merge pull request #34876 from bogdanvlviv/remove-needless-comment-actiontext.gemspec
Remove comment from `actiontext/actiontext.gemspec`
2019-01-05 10:41:08 -05:00
George Claghorn
a13612b070
Merge pull request #34874 from bogdanvlviv/fix-RichText-api-docs
Fix API docs of `ActionText::RichText` [ci skip]
2019-01-05 10:40:37 -05:00
Javan Makhmali
2832ca131d
Merge pull request #34709 from gmcgibbon/action_cable_guides_es6
Use ES6 and Webpacker in ActionCable guide.
2019-01-05 06:18:15 -08:00
bogdanvlviv
67a9a86b1d
Test actiontext on Rails 6.0
- config.load_defaults 6.0 in the dummy app and
  fix the test since by default rails 6.0 configured
  does not generate "utf8" hidden input, see #32125
- Use `ActiveRecord::Migration[6.0]` in the dummy app
  since actiontext will be since Rails 6.0
- Fix `CreateActiveStorageTables` migration in the dummy app.
  Add `t.foreign_key :active_storage_blobs, column: :blob_id`
  It was added in 2ae3a29508e.
- `rails/actiontext$ yarn install`
2019-01-05 15:24:27 +02:00
bogdanvlviv
6b8048173d
Add --skip-action-text option to rails new
Since PR#34816 was merged in c6ef670aee186a2880b7be59c4c6892b5c983e58,
we should add this option for flexibility, and consistency.
2019-01-05 13:54:35 +02:00
bogdanvlviv
0fb6c9011f
Add Action Text to guides [ci skip]
- Move some actiontext/README.md content to Action Text Overview guide
- I added WIP label to that guide since we definitely want to complement it.
- Add Action Text to Major Features of Rails 6.0

Similar approach was used in #34812
2019-01-05 13:30:37 +02:00
bogdanvlviv
3bf3286ba0
Add action_text_content hook to the guide [ci skip]
See actiontext/lib/action_text/content.rb:132
2019-01-05 12:17:26 +02:00
bogdanvlviv
b04b008b3d
Remove comment from actiontext/actiontext.gemspec
This comment was autogenerated, see
`railties/lib/rails/generators/rails/plugin/templates/%name%.gemspec.tt`
Since actiontext is well described in this file, I think we shouldn't
keep this comment. Note that this commit is more like cosmetic change,
so it is OK if we don't merge this.
2019-01-05 11:57:26 +02:00
bogdanvlviv
78ed534f30
Fix API docs of ActionText::RichText [ci skip]
This text should appear on the page
https://api.rubyonrails.org/v6.0/classes/ActionText/RichText.html

Related to 86517942e469193e8624d5078d718785552c1270
2019-01-05 11:01:47 +02:00
George Claghorn
86517942e4 Generate Action Text's API docs 2019-01-04 23:56:22 -05:00
George Claghorn
76c02013ad Label Action Text PRs [ci skip] 2019-01-04 23:48:30 -05:00
George Claghorn
df8ee09ce7
Merge pull request #34873 from georgeclaghorn/actiontext
Import Action Text
2019-01-04 23:09:12 -05:00
George Claghorn
0decd2ddc4 Import Action Text 2019-01-04 22:22:49 -05:00
Rosa Gutierrez
88349cee3c Support in-flight jobs stored before individual execution counters for retry_on (#34731)
Also, make tests and examples for individual execution counters
clearer, as it wasn't entierly clear what would happen in this case:

```
retry_on CustomException, OtherException, attempts: 3
```

The job would be retried at most 3 times in total, for both
CustomException and OtherException. To have the job retry 3 times at
most for each exception individually, the following retry_on
declarations are necessary:

```
retry_on CustomException, attempts: 3
retry_on OtherException, attempts: 3
```
2019-01-05 13:54:38 +13:00
Gannon McGibbon
195da08ef7 Use ES6 and Webpacker in ActionCable guide.
[ci skip]
2019-01-04 17:31:24 -05:00
Rikki Pitt
cfe4674d36 Update tag helper routes for use in engines (#49)
When using the `rich_text_area_tag` form helper from within a Rails
engine, the direct_upload_url and blob_url_template options would
default to non-existent routes.

By prefixing these routes with `main_app` we ensure the application
root is used rather than the engine.
2019-01-04 13:57:43 -08:00
George Claghorn
8a23a0e8c2
Merge pull request #34867 from bogdanvlviv/test-actionmailbox-configurations
Test Action Mailbox configurations
2019-01-04 16:17:51 -05:00
Kasper Timm Hansen
188ce3567f
Merge pull request #34870 from bogdanvlviv/fix-new_framework_defaults_6_0.rb-file
Fix `new_framework_defaults_6_0.rb` file
2019-01-04 22:05:18 +01:00
Rafael França
d3159cec60
Merge pull request #34866 from bogdanvlviv/add-activemodel_errors_of_kind
Add `ActiveModel::Errors#of_kind?`
2019-01-04 15:53:55 -05:00