Commit Graph

5454 Commits

Author SHA1 Message Date
Rafael Mendonça França 457d2ab97b
Specify which series I'm talking about
[ci skip]
2018-04-10 18:42:27 -04:00
Rafael Mendonça França 22b0a30215
Update our security policy to include all releases in the current series
We don't want people to jump from the last release in the previous
series (4.2) straing to the first release in the current series that is
support (5.1), so we should be supporting the entire series for severe
security issues.

This will not be a problem because usually we only have 3 releases in a
series and backporting patches inside the same series is not harder than
backporting to a previous series.
2018-04-10 18:38:33 -04:00
Rafael Mendonça França c6ae623955
4.2 is still maintained
It is the last major release series.
2018-04-10 02:01:58 -04:00
Ryuta Kamizono c14deceb9f
Merge pull request #32508 from radar/radar/maintenance-policy
Correct Maintenance Policy for Rails 5.2

[ci skip]
2018-04-10 11:35:39 +09:00
bogdanvlviv f0eb637f52
Update bug report templates
Set Rails 5.2.0 in templates
2018-04-10 04:32:42 +03:00
Ryan Bigg 0d6bb453d7 Correct Maintenance Policy for Rails 5.2 2018-04-10 10:33:05 +10:00
Yoshiyuki Hirano b72dc84ba5 [ci skip] Add securing rails app guide link to credential section
* In 5.2 release note, added [securing rails app guide](http://edgeguides.rubyonrails.org/security.html#custom-credentials) link to [credentials section](http://edgeguides.rubyonrails.org/5_2_release_notes.html#credentials).
2018-04-07 02:35:02 +09:00
Yoshiyuki Hirano 34a10e0c41 [ci skip] Add :private option to delegate section in guide 2018-04-04 20:05:45 +09:00
Xavier Noria 61f0e9f323 removes obsolete images in guides [ci skip]
Note that tab_yellow.gif exists, that is the one being used.
2018-04-03 20:43:53 +02:00
Xavier Noria 7dcfd30cd9 remove obsolete author images
The credits page is gone after #32429, these images are now orphan.
2018-04-03 20:14:41 +02:00
Prathamesh Sonpatki ecb6ee5948
Cleanup credits related code as it is removed now in PR #32429 2018-04-03 15:19:57 +05:30
Yoshiyuki Hirano a105374bab Remove credits.html from Rails Guides
* refs #32420
2018-04-03 10:45:03 +09:00
Simon Coffey eede8d8130 Add `action_view.finalize_compiled_template_methods` config option
ActionView::Template instances compile their source to methods on the
ActionView::CompiledTemplates module. To prevent leaks in development
mode, where templates can frequently change, a finalizer is added that
undefines these methods[1] when the templates are garbage-collected.

This is undesirable in the test environment, however, as templates don't
change during the life of the test. Moreover, the cost of undefining a
method is proportional to the number of descendants a class or module
has, since the method cache must be cleared for all descendant classes.

As ActionView::CompiledTemplates is mixed into every
ActionView::TestCase (or in RSpec suites, every view spec example
group), it can end up with a very large number of descendants, and
undefining its methods can become very expensive.

In large test suites, this results in a long delay at the end of the
test suite as all template finalizers are run, only for the process to
then exit.

To avoid this unnecessary cost, this change adds a config option,
`action_view.finalize_compiled_template_methods`, defaulting to true,
and sets it to false in the test environment only.

[1] 09b2348f7f/actionview/lib/action_view/template.rb (L118-L126)
2018-04-02 20:50:33 +01:00
Yoshiyuki Hirano f8d346f9fd Not generate needless files in guides
Not generate needless files:

* _license.html.erb, _welcome.html.erb are partial files.
* layout.html.erb is the layout file.
2018-04-02 18:30:23 +09:00
Xavier Noria 088cf26939
Merge pull request #32397 from yhirano55/remove_needless_images_in_guides
Remove needless images in guides
2018-03-31 17:47:33 +02:00
Yoshiyuki Hirano 161e991ec4 Remove needless images in guides 2018-03-31 23:51:27 +09:00
Yoshiyuki Hirano e5bd4adce9 Put images into each page's dir in guides 2018-03-31 23:50:51 +09:00
Andrew White cbb054a0a9
Merge pull request #32395 from yhirano55/use_oxford_comma_style_in_guide
[ci skip] Use Oxford comma style in guide
2018-03-31 15:12:54 +01:00
Andrew White f4680e4923
Revert "[ci skip] Capitalize sentence of first char in AS guide"
The text is a continuation of the sentence before the listing so
doesn't need to begin with a capital letter.

This reverts commit 77a7acafba.
2018-03-31 14:26:28 +01:00
Yoshiyuki Hirano df75a5a9ab [ci skip] Use Oxford comma style in guide 2018-03-31 22:23:03 +09:00
Andrew White bc5149b3de
Merge pull request #32392 from yhirano55/capitalize_sentence_of_first_char_in_as_guide
[ci skip] Capitalize sentence of first char in AS guide
2018-03-31 13:55:30 +01:00
Ryuta Kamizono 5616c08401
Merge pull request #32389 from yhirano55/add_earlier_releases_in_guides
Add earlier releases v3.0, v3.1 in guides
2018-03-31 20:57:50 +09:00
Yoshiyuki Hirano 77a7acafba [ci skip] Capitalize sentence of first char in AS guide 2018-03-31 20:52:11 +09:00
Ryuta Kamizono 00ed37177b
Merge pull request #32388 from yhirano55/remove_useless_stylesheet_file_in_guide
Remove useless stylesheet file in guide
2018-03-31 20:49:40 +09:00
Yoshiyuki Hirano 2a4122f756 [ci skip] Modify twitter api link in api guide
* The twitter developer site's url was changed.
2018-03-31 19:14:35 +09:00
Yoshiyuki Hirano bc68d62be4 Add earlier releases links v3.0 and v3.1 in guides 2018-03-31 19:01:43 +09:00
Yoshiyuki Hirano 55dc7f9e88 Remove useless stylesheet file in guide 2018-03-31 18:03:53 +09:00
Guillermo Iguaran c680080967
Merge pull request #32277 from derekprior/dp-deprecate-force-ssl
Deprecate controller level force_ssl
2018-03-30 09:02:49 -05:00
Derek Prior 4701a50b58
Deprecate controller level force_ssl
Today there are two common ways for Rails developers to force their
applications to communicate over HTTPS:

* `config.force_ssl` is a setting in environment configurations that
  enables the `ActionDispatch::SSL` middleware. With this middleware
  enabled, all HTTP communication to your application will be redirected
  to HTTPS. The middleware also takes care of other best practices by
  setting HSTS headers, upgrading all cookies to secure only, etc.
* The `force_ssl` controller method redirects HTTP requests to certain
  controllers to HTTPS.

As a consultant, I've seen many applications with misconfigured HTTPS
setups due to developers adding `force_ssl` to `ApplicationController`
and not enabling `config.force_ssl`. With this configuration, many
application requests can be served over HTTP such as assets, requests
that hit mounted engines, etc. In addition, because cookies are not
upgraded to secure only in this configuration and HSTS headers are not
set, it's possible for cookies that are meant to be secure to be sent
over HTTP.

The confusion between these two methods of forcing HTTPS is compounded
by the fact that they share an identical name. This makes finding
documentation on the "right" method confusing.

HTTPS throughout is quickly becomming table stakes for all web sites.
Sites are expected to operate over HTTPS for all communication,
sensitive or otherwise. Let's encourage use of the broader-reaching
`ActionDispatch::SSL` middleware and elminate this source of user
confusion. If, for some reason, applications need to expose certain
endpoints over HTTP they can do so by properly configuring
`config.ssl_options`.
2018-03-30 09:58:28 -04:00
Guillermo Iguaran 7b668e2d42
Merge pull request #32299 from davidstosik/expose-fk-ignore-pattern
Expose foreign key name ignore pattern in configuration
2018-03-27 11:41:12 -05:00
Isaac Orme 2273f5228a Readability fix [ci skip] 2018-03-25 13:02:11 -07:00
David Stosik f6e612b272 Move fk_ignore_pattern from config.active_record to SchemaDumper
This makes more sense, as the foreign key ignore pattern is only used by
the schema dumper.
2018-03-22 10:12:58 +00:00
Ryuta Kamizono 4c9c3ffc2e Merge pull request #31869 from BKSpurgeon/patch-1
[ci skip] Update Action Mailer Documentation
2018-03-22 07:07:33 +09:00
David Stosik 864e500817 Document config.active_record.fk_ignore_pattern 2018-03-20 18:08:11 +00:00
Brian Knight c1600009b2 Allow full use of the AWS S3 SDK authentication options (#32270)
If an explicit AWS key pair and/or region is not provided in
config/storage.yml, attempt to use environment variables, shared
credentials, or IAM role credentials. Order of precedence is
determined by the AWS SDK[1].

[1]: https://docs.aws.amazon.com/sdk-for-ruby/v3/developer-guide/setup-config.html
2018-03-19 15:25:40 +00:00
bogdanvlviv 8b26de85e8
Move CSP info from 5.2 release notes to guide [ci skip]
- Add mention about "nonce".

Related to https://github.com/rails/rails/pull/32222#issuecomment-372268157
2018-03-18 23:25:19 +02:00
Kasper Timm Hansen d9736e50d8
Merge pull request #32281 from bogdanvlviv/fix-rails_5_2-notes-32222
Fix "Ruby on Rails 5.2 Release Notes" [ci skip]
2018-03-18 17:48:46 +01:00
bogdanvlviv b5b179fb57
Fix "Ruby on Rails 5.2 Release Notes" [ci skip]
- Remove
  ```
  *   Namespace error pages' CSS selectors to stop the styles from bleeding
      into other pages when using Turbolinks.
      ([Pull Request](https://github.com/rails/rails/pull/28814))
  ```
  since it was backported to
  `5-1-stable` by 50d5baf7ed
  and
  `5-0-stable` by d1c4a39ed7.

- Remove
  ```
  *   Allow irb options to be passed from `rails console` command.
      ([Pull Request](https://github.com/rails/rails/pull/29010))
  ```
  since it was backported to
  `5-1-stable` by e91b48348c.

- Remove
  ```
  *   Load environment file in `dbconsole` command.
      ([Pull Request](https://github.com/rails/rails/pull/29725))
  ```
  since it was backported to
  `5-1-stable` by 7f9342877a.

- Remove
  ```
  *   Gemfile for new apps: upgrade redis-rb from ~> 3.0 to 4.0.
      ([Pull Request](https://github.com/rails/rails/pull/30748))
  ```
  since it was backported to
  `5-1-stable` by 3789531151.

- Remove
  ```
  *   Fix minitest rails plugin.
      The custom reporters are added only if needed.
      This will fix conflicts with others plugins.
      ([Commit](ac99916fcf))
  ```
  since it was backported to
  `5-1-stable` by caa76956d3.

- Remove
  ```
  *   Add support for compatibility with redis-rb gem for 4.0 version.
      ([Pull Request](https://github.com/rails/rails/pull/30748))
  ```
  since it was backported to
  `5-1-stable` by 3789531151.

- Remove
  ```
  *   Add `action_controller_api` and `action_controller_base` load hooks to be
      called in `ActiveSupport.on_load`.
      ([Pull Request](https://github.com/rails/rails/pull/28402))
  ```
  since it was backported to
  `5-1-stable` by b9a5fd706a.

- Remove
  ```
  *   `driven_by` now registers poltergeist and capybara-webkit.
      ([Pull Request](https://github.com/rails/rails/pull/29315))
  ```
  since it was backported to
  `5-1-stable` by c5dd45119a.

- Remove
  ```
  *   Fallback `ActionController::Parameters#to_s` to `Hash#to_s`.
      ([Pull Request](https://github.com/rails/rails/pull/29630))
  ```
  since it was backported to
  `5-1-stable` by c1014e435d
  and
  `5-0-stable` by 0e71fc3040.

- Remove
  ```
  *   Make `take_failed_screenshot` work within engine.
      ([Pull Request](https://github.com/rails/rails/pull/30421))
  ```
  since it was backported to
  `5-1-stable` by 595a231029.

- Remove
  ```
  *   Fix optimized url helpers when using relative url root.
      ([Pull Request](https://github.com/rails/rails/pull/31261))
  ```
  since it was backported to
  `5-1-stable` by e9b77953a2.

- Remove
  ```
  *   Update `distance_of_time_in_words` helper to display better error messages
      for bad input.
      ([Pull Request](https://github.com/rails/rails/pull/20701))
  ```
  since it was backported to
  `5-1-stable` by 2c97fbf650.

- Remove
  ```
  *   Generate field ids in `collection_check_boxes` and
      `collection_radio_buttons`.
      ([Pull Request](https://github.com/rails/rails/pull/29412))
  ```
  since it was backported to
  `5-1-stable` by 2d8c10a7b1.

- Remove
  ```
  *   Fix issues with scopes and engine on `current_page?` method.
      ([Pull Request](https://github.com/rails/rails/pull/29503))
  ```
  since it was backported to
  `5-1-stable` by 2135daf0d5.

- Remove
  ```
  *   Bring back proc with arity of 1 in `ActionMailer::Base.default` proc
      since it was supported in Rails 5.0 but not deprecated.
      ([Pull Request](https://github.com/rails/rails/pull/30391))
  ```
  since it was backported to
  `5-1-stable` by b2bedb1492.

- Remove
  ```
  *   Add type caster to `RuntimeReflection#alias_name`.
      ([Pull Request](https://github.com/rails/rails/pull/28961))
  ```
  since it was backported to
  `5-1-stable` by f644e7a6fd.

- Remove
  ```
  *   Loading model schema from database is now thread-safe.
      ([Pull Request](https://github.com/rails/rails/pull/29216))
  ```
  since it was backported to
  `5-1-stable` by 02926cfff6.
  and
  `5-0-stable` by 84bcfe5a6a

- Remove
  ```
  *   Fix destroying existing object does not work well when optimistic locking
      enabled and `locking_column` is null in the database.
      ([Pull Request](https://github.com/rails/rails/pull/28926))
  ```
  since it was backported to
  `5-1-stable` by e498052c52.

- Remove
  ```
  *   `ActiveRecord::Persistence#touch` does not work well
      when optimistic locking enabled and `locking_column`,
      without default value, is null in the database.
      ([Pull Request](https://github.com/rails/rails/pull/28914))
  ```
  since it was backported to
  `5-1-stable` by 1e2f63db78.

- Remove
  ```
  *   Previously, when building records using a `has_many :through` association,
      if the child records were deleted before the parent was saved,
      they would still be persisted. Now, if child records are deleted
      before the parent is saved on a `has_many :through` association,
      the child records will not be persisted.
      ([Pull Request](https://github.com/rails/rails/pull/29593))
  ```
  since it was backported to
  `5-1-stable` by a22c39e9cc.

- Remove
  ```
  *   Query cache was unavailable when entering the `ActiveRecord::Base.cache`
      block without being connected.
      ([Pull Request](https://github.com/rails/rails/pull/29609))
  ```
  since it was backported to
  `5-1-stable` by fd6c8cdfe6
  and
  `5-0-stable` by 9f2532bb16.

- Remove
  ```
  *   `Relation#joins` is no longer affected by the target model's
      `current_scope`, with the exception of `unscoped`.
      ([Commit](5c71000d08))
  ```
  since it was backported to
  `5-1-stable` by 3630d6354c.

- Remove
  ```
  *   Fix `unscoped(where: [columns])` removing the wrong bind values.
      ([Pull Request](https://github.com/rails/rails/pull/29780))
  ```
  since it was backported to
  `5-1-stable` by d378fcb254.

- Remove
  ```
  *   When a `has_one` association is destroyed by `dependent: destroy`,
      `destroyed_by_association` will now be set to the reflection, matching the
      behaviour of `has_many` associations.
      ([Pull Request](https://github.com/rails/rails/pull/29855))
  ```
  since it was backported to
  `5-1-stable` by 8254a8be81.

- Remove
  ```
  *   Fix `COUNT(DISTINCT ...)` with `ORDER BY` and `LIMIT`
      to keep the existing select list.
      ([Pull Request](https://github.com/rails/rails/pull/29848))
  ```
  since it was backported to
  `5-1-stable` by 0e8d4edd56.

- Remove
  ```
  *   Ensure `sum` honors `distinct` on `has_many :through` associations.
      ([Commit](566f1fd068))
  ```
  since it was backported to
  `5-1-stable` by c0a1dc2561.

- Remove
  ```
  *   Fix `COUNT(DISTINCT ...)` for `GROUP BY` with `ORDER BY` and `LIMIT`.
      ([Commit](5668dc6b18))
  ```
  since it was backported to
  `5-1-stable` by 87ca68e76e.

- Remove
  ```
  *   MySQL: Don't lose `auto_increment: true` in the `db/schema.rb`.
      ([Commit](9493d45535))
  ```
  since it was backported to
  `5-1-stable` by 8b6e694e5f.

- Remove
  ```
  *   Fix longer sequence name detection for serial columns.
      ([Pull Request](https://github.com/rails/rails/pull/28339))
  ```
  since it was backported to
  `5-1-stable` by af9c1707ad
  and
  `5-0-stable` by 7025b1d8eb.

- Remove
  ```
  *   Fix `bin/rails db:setup` and `bin/rails db:test:prepare` create wrong
      ar_internal_metadata's data for a test database.
      ([Pull Request](https://github.com/rails/rails/pull/30579))
  ```
  since it was backported to
  `5-1-stable` by bb67b5f278
  and
  `5-0-stable` by 60437e6d3c.

- Remove
  ```
  *   Fix conflicts `counter_cache` with `touch: true` by optimistic locking.
      ([Pull Request](https://github.com/rails/rails/pull/31405))
  ```
  since it was backported to
  `5-1-stable` by 5236ddaf35.

- Remove
  ```
  *   Fix `count(:all)` to correctly work `distinct` with custom SELECT list.
      ([Commit](c6cd9a59f2))
  ```
  since it was backported to
  `5-1-stable` by 6beb4de7dd.

- Remove
  ```
  *   Fix to invoke callbacks when using `update_attribute`.
      ([Commit](732aa34b6e))
  ```
  since it was backported to
  `5-1-stable` by 6346683bc5.

- Remove
  ```
  *   Use `count(:all)` in `HasManyAssociation#count_records` to prevent invalid
      SQL queries for association counting.
      ([Pull Request](https://github.com/rails/rails/pull/27561))
  ```
  since it was backported to
  `5-1-stable` by eef3c89e3b.

- Remove
  ```
  *   Fix `count(:all)` with eager loading and having an order other than
      the driving table.
      ([Commit](ebc09ed9ad))
  ```
  since it was backported to
  `5-1-stable` by 6df9b69b23.

- Remove
  ```
  *   PostgreSQL: Allow pg-1.0 gem to be used with Active Record.
      ([Pull Request](https://github.com/rails/rails/pull/31671))
  ```
  since it was backported to
  `5-1-stable` by a9c06f61d5.

- Remove
  ```
  *   Fix that after commit callbacks on update does not triggered
      when optimistic locking is enabled.
      ([Commit](7f9bd034c4))
  ```
  since it was backported to
  `5-1-stable` by aaee10e6e4.

- Remove
  ```
  *   Fix regression in numericality validator when comparing Decimal and Float
      input values with more scale than the schema.
      ([Pull Request](https://github.com/rails/rails/pull/28584))
  ```
  since it was backported to
  `5-1-stable` by 5b1c3e5a8b.
  Note that there was incorrect link to PR,
  original PR is https://github.com/rails/rails/pull/29249.

- Remove
  ```
  *   Fix to working before/after validation callbacks on multiple contexts.
      ([Pull Request](https://github.com/rails/rails/pull/31483))
  ```
  since it was backported to
  `5-1-stable` by 0f7046a7f8.

- Remove
  ```
  *   Fix implicit coercion calculations with scalars and durations.
      ([Pull Request](https://github.com/rails/rails/pull/29163),
      [Pull Request](https://github.com/rails/rails/pull/29971))
  ```
  since it was backported to
  `5-1-stable` by 51ea27c04c,
                  4d82e2aad9.

- Remove
  ```
  *   Fix modulo operations involving durations.
      ([Commit](a54e13bd2e))
  ```
  since it was backported to
  `5-1-stable` by 233fa7eab3.

- Remove
  ```
  *   Return all mappings for a timezone identifier in `country_zones`.
      ([Commit](cdce6a709e))
  ```
  since it was backported to
  `5-1-stable` by 0222ebbe06.

- Remove
  ```
  *   Add support for compatibility with redis-rb gem for 4.0 version.
      ([Pull Request](https://github.com/rails/rails/pull/30748))
  ```
  since it was backported to
  `5-1-stable` by 3789531151.
  Related to #32252.

Related to #32222, https://github.com/rails/rails/pull/32222#discussion_r174256536.
Follow up a489cc81b6.
2018-03-18 15:33:26 +02:00
Stefan Wrobel a6b82a3779 Update Redis cache store docs 2018-03-17 16:09:09 -07:00
ef718 aa8f51b97c Fix grammar in Getting Started with Rails 2018-03-16 18:02:48 -04:00
Jon Evans cdfecb800c
Fix typo in active_job_basics.md
`it's` -> `its`
2018-03-15 12:17:04 -06:00
bogdanvlviv c8a22bb9ee
Update "Upgrading from Rails 5.1 to Rails 5.2" [ci skip]
Add section "Expiry in signed or encrypted cookie is now embedded in the cookies values"
to `master` since it should always be in the guides, not only for version 5.2.

Add info about `config.action_dispatch.use_authenticated_cookie_encryption`
to the "Configuring Rails Applications" guide.

It was committed straight  to `5-2-stable` since we don't need this
functionality in 6.0. Related to b25fcbc074.
2018-03-14 14:19:27 +02:00
Yuji Yaginuma a489cc81b6 Remove entry that was backported to Rails 5.1.3. [ci skip] 2018-03-14 07:55:25 +09:00
Rafael Mendonça França ba0ae542ca
Remove changelog header for unreleased version
We only add the header when releasing to avoid some conflicts.

[ci skip]
2018-03-13 15:20:57 -04:00
bogdanvlviv 7fd6d69af2
Update "Ruby on Rails 5.2 Release Notes" Guide [ci skip]
- Add a description of major features in Rails 5.2.
- Add a reference to Pull Request/Commit to every entry in CHANGELOGs,
  note that some of them combined.
- Add section "Ruby on Rails Guides" with notable changes.
- Note that
  - Skipped this since encrypted secrets are already on the way out.
    ```
    *   Add `rails secrets:show` command.
        ([Pull Request](https://github.com/rails/rails/pull/29695))
    ```
  - Skipped this since it was backported all the way to 5-0-stable.
    ```
    *   Make Rails' test runner work better with minitest plugins.
        ([Pull Request](https://github.com/rails/rails/pull/29572))
    ```

Thanks to everyone who has been working on Rails 5.2! <3
2018-03-13 12:20:51 +02:00
Andrew White 309bb6c4d0 Remove path config option from Azure service
The Active Storage service for Azure Storage has an option called `path`
that is ambiguous in meaning. It needs to be set to the primary blob
storage endpoint but that can be determined from the blobs client anyway.

To simplify the configuration this commit removes the `path` option and
gets the endpoint from the blobs client instead.

Closes #32225.
2018-03-12 17:39:58 +00:00
Kasper Timm Hansen 7bede102d2
[ci skip] Add missing do. 2018-03-12 14:55:58 +01:00
Andrew White 6fdc379c19 Add section to routing guide about config/routes.rb [ci skip]
Closes #32219.
2018-03-12 13:42:08 +00:00
Yauheni Dakuka f1b1494484 Fix note marks [ci skip] 2018-03-12 15:36:26 +03:00
Chris Salzberg fc55c34bea Update some i18n references in guides (#32182)
* Remove reference to Globalize::Backend::Static as this class no longer exists.
* Remove reference to google group
* Remove confusing reference to Globalize3
* Add section on translating stored content
2018-03-09 10:51:30 +00:00