aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Autocorrect `refute` RuboCop violationsDaniel Colson2018-04-0314-27/+27
| | | | | | 73e7aab behaved as expected on codeship, failing the build with exactly these RuboCop violations. Hopefully `rubocop -a` will have been enough to get a passing build!
* Add custom RuboCop for `assert_not` over `refute`Daniel Colson2018-04-036-0/+196
| | | | | | | | | | | | | | | | | | | | | | | Since at least cf4afc4 we have preferred `assert_not` methods over `refute` methods. I have seen plenty of comments in PRs about this, and we have tried to fix it a few times (5294ad8, e45f176, 8910f12, 41f50be, d4cfd54, 48a183e, and 211adb4), but the `refute` methods keep sneaking back in. This custom RuboCop will take care of enforcing this preference, so we don't have to think about it again. I suspect there are other similar stylistic preferences that could be solved with some custom RuboCops, so I will definitely keep my eyes open. `assert_not` over `assert !` might be a good candidate, for example. I wasn't totally sure if `ci/custom_cops` was the best place to put this, but nothing else seemed quite right. At one point I had it set up as a gem, but I think custom cops like this would have limited value in another context. I want to see how code climate handles the new cops before autocorrecting the existing violations. If things go as expected, I will push another commit with those corrections.
* Merge pull request #32407 from razh/fix-rails-ujs-html-content-testYuji Yaginuma2018-04-021-1/+1
|\ | | | | Fix typo in rails-ujs HTML content test
| * Fix typo in rails-ujs HTML content testRaymond Zhou2018-04-011-1/+1
|/ | | | `</ps>` is not a valid closing tag for `<p>`.
* Merge pull request #32406 from ↵Kasper Timm Hansen2018-04-014-23/+23
|\ | | | | | | | | olivierlacan/actionview-helpers-docs-consistent-spacing Use consistent spacing in actionview helper docs
| * Use consistent spacing in actionview helper docs [ci skip]Olivier Lacan2018-04-014-23/+23
| | | | | | | | | | | | | | | | The spacing in these comments is fairly inconsistent. Array argument contents are often separated with a space from the array literal brackets but in several cases the Hash literal curly braces are tangent to their contents which makes the documentation harder to read in some cases.
* | Merge pull request #32287 from razh/fix-rails-ujs-html-contentKasper Timm Hansen2018-04-012-1/+12
|\ \ | |/ |/| Pass HTML responses as plain-text in rails-ujs
| * Pass HTML responses as plain-text in rails-ujsRaymond Zhou2018-03-192-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Running HTML responses through `DOMParser#parseFromString` results in complete `HTMLDocument` instances with unnecessary surrounding tags. For example: new DOMParser().parseFromString('<p>hello</p>', 'text/html') Will output: <html> <head></head> <body> <p>hello</p> </body> </html> This is passed to the `ajax:success` handler as `event.detail[0]` (`data`), but cannot be used directly without first traversing the document. To resolve this, only XML content is passed through `parseFromString`, while HTML content is treated as plain-text. This matches the behavior of jquery-ujs, which relied on jQuery's response-type inference.
* | Merge pull request #32268 from freeletics/encrypted-tmp-file-nameKasper Timm Hansen2018-04-011-1/+1
|\ \ | | | | | | Change temporary file name extension while editing encrypted file.
| * | Change temporary file name extension while editing encrypted file.Wojciech Wnętrzak2018-03-181-1/+1
| | | | | | | | | | | | To have syntax highlighting in an editor try to preserve original extension of edited file.
* | | Merge pull request #32400 from ↵Andrew White2018-04-011-0/+2
|\ \ \ | | | | | | | | | | | | | | | | utilum/cleanup_after_sqlite3_connection_handler_test Remove leftover blank sqlite3 file after in memory handler tests.
| * | | Remove leftover blank sqlite3 file after in memory handler tests.utilum2018-04-011-0/+2
|/ / /
* | | Merge pull request #32398 from ↵Ryuta Kamizono2018-04-018-42/+22
|\ \ \ | | | | | | | | | | | | | | | | bogdanvlviv/32185-dry-in-before-after-mehtods-implementation Move implementation of `before?` and `after?` to `DateAndTime::Calculations`
| * | | Move implementation of `before?` and `after?` to `DateAndTime::Calculations`bogdanvlviv2018-03-318-42/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This prevents duplication of code. Prevent duplication of tests by moving them to `DateAndTimeBehavior`. Related to #32185.
* | | | Merge pull request #32396 from eugeneius/database_configurations_urlEileen M. Uchitelle2018-03-312-11/+53
|\ \ \ \ | | | | | | | | | | Fix two-level database configurations with URLs
| * | | | Fix two-level database configurations with URLsEugene Kenny2018-03-312-11/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An entry in `ActiveRecord::Base.configurations` can either be a connection spec ("two-level") or a hash of specs ("three-level"). We were detecting two-level configurations by looking for the `database` key, but the database can also be specified as part of the `url` key, which meant we incorrectly treated those configurations as three-level.
* | | | | Merge pull request #32397 from yhirano55/remove_needless_images_in_guidesXavier Noria2018-03-3141-15/+10
|\ \ \ \ \ | | | | | | | | | | | | Remove needless images in guides
| * | | | | Remove needless images in guidesYoshiyuki Hirano2018-03-3128-5/+0
| | | | | |
| * | | | | Put images into each page's dir in guidesYoshiyuki Hirano2018-03-3113-10/+10
| | |/ / / | |/| | |
* | | | | Merge pull request #32394 from yskkin/key_generatorAndrew White2018-03-312-1/+2
|\ \ \ \ \ | | | | | | | | | | | | Deriving `secret_key_base` breaks `key_generator` defined in 5.1.
| * | | | | Deriving `secret_key_base` breaks `key_generator` defined in 5.1.Yoshiyuki Kinjo2018-03-312-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If one created Rails 5.1 app and then updated to 5.2, `secret_key_base` defined in `config/secrets.yml` is ignored for `development` and `test` environment. A change in `secret_key_base` in turn breaks `Rails.application.key_generator`. If one encrypt data in Rails 5.1, she cannot decrypt it in Rails 5.2 for `development` and `test` environment.
* | | | | | Merge pull request #32395 from yhirano55/use_oxford_comma_style_in_guideAndrew White2018-03-311-1/+1
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | [ci skip] Use Oxford comma style in guide
| * | | | | [ci skip] Use Oxford comma style in guideYoshiyuki Hirano2018-03-311-1/+1
| | | | | |
* | | | | | Merge pull request #32386 from utilum/tmpname_basenameAndrew White2018-03-311-1/+3
|\ \ \ \ \ \ | |_|_|/ / / |/| | | | | | | | | | | Fix: FileStoreTest#test_filename_max_size fails in Ruby 2.5.1
| * | | | | Fix: FileStoreTest#test_filename_max_size fails in Ruby 2.5.1utilum2018-03-311-1/+3
|/ / / / /
* / / / / Revert "[ci skip] Capitalize sentence of first char in AS guide"Andrew White2018-03-311-1/+1
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | The text is a continuation of the sentence before the listing so doesn't need to begin with a capital letter. This reverts commit 77a7acafba11fccac8b4cf30a9ce62d43a9ac186.
* | | | Merge pull request #32392 from ↵Andrew White2018-03-311-1/+1
|\ \ \ \ | |/ / / |/| | | | | | | | | | | yhirano55/capitalize_sentence_of_first_char_in_as_guide [ci skip] Capitalize sentence of first char in AS guide
| * | | [ci skip] Capitalize sentence of first char in AS guideYoshiyuki Hirano2018-03-311-1/+1
| | | |
* | | | Merge pull request #32389 from yhirano55/add_earlier_releases_in_guidesRyuta Kamizono2018-03-311-1/+3
|\ \ \ \ | | | | | | | | | | Add earlier releases v3.0, v3.1 in guides
| * | | | Add earlier releases links v3.0 and v3.1 in guidesYoshiyuki Hirano2018-03-311-1/+3
| | | | |
* | | | | Merge pull request #32388 from yhirano55/remove_useless_stylesheet_file_in_guideRyuta Kamizono2018-03-311-50/+0
|\ \ \ \ \ | | | | | | | | | | | | Remove useless stylesheet file in guide
| * | | | | Remove useless stylesheet file in guideYoshiyuki Hirano2018-03-311-50/+0
| |/ / / /
* | | | | Bump tested versions of Ruby on CIAndrew White2018-03-311-8/+8
| | | | |
* | | | | Merge pull request #32390 from yhirano55/modify_twitter_api_link_in_api_guideRyuta Kamizono2018-03-311-1/+1
|\ \ \ \ \ | |_|/ / / |/| | | | [ci skip] Modify twitter api link in api guide
| * | | | [ci skip] Modify twitter api link in api guideYoshiyuki Hirano2018-03-311-1/+1
|/ / / / | | | | | | | | | | | | * The twitter developer site's url was changed.
* | | | Merge pull request #32366 from utilum/use_current_configAndrew White2018-03-301-1/+1
|\ \ \ \ | | | | | | | | | | Use current_config in structure_dump
| * | | | Use current_config in structure_dumputilum2018-03-291-1/+1
| | | | | | | | | | | | | | | | | | | | This looks like a typo from 0f0aa6a275876502e002c054896734d6536ba5cd
* | | | | Merge pull request #32277 from derekprior/dp-deprecate-force-sslGuillermo Iguaran2018-03-307-90/+62
|\ \ \ \ \ | | | | | | | | | | | | Deprecate controller level force_ssl
| * | | | | Deprecate controller level force_sslDerek Prior2018-03-307-90/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`.
* | | | | | Merge pull request #32384 from riseshia/remove-expired-documentAndrew White2018-03-301-15/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | Remove expired explanation [ci skip]
| * | | | | | Remove expired explanation [ci skip]Shia2018-03-301-15/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Override callback doesn't work anymore.
* | | | | | | Remove shadowing variable warningAndrew White2018-03-301-2/+2
|/ / / / / /
* | | | | | Merge pull request #32383 from freeletics/add-missing-requireRyuta Kamizono2018-03-301-0/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | Adding missing extension for `cattr_accessor` method
| * | | | | | Adding missing extension for `cattr_accessor` methodWojciech Wnętrzak2018-03-301-0/+1
|/ / / / / /
* | | | | | Fix intermittent CI failure due to setting explicit `person.id = 10`Ryuta Kamizono2018-03-301-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | https://travis-ci.org/rails/rails/jobs/360109429
* | | | | | Merge pull request #32338 from eugeneius/dont_clobber_foreign_keyRyuta Kamizono2018-03-302-2/+4
|\ \ \ \ \ \ | | | | | | | | | | | | | | Don't unset foreign key when preloading missing record
| * | | | | | Don't unset foreign key when preloading missing recordEugene Kenny2018-03-242-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a belongs to association's target is set, its foreign key is now updated to match the new target. This is the correct behaviour when a new record is assigned, but not when the existing record is preloaded. As long as we mark the association as loaded, we can skip setting the target when the record is missing and avoid clobbering the foreign key.
* | | | | | | Short circuit the scoping delegation for `relation.all`Ryuta Kamizono2018-03-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously `relation.all` behaves as `relation.scoping { klass.all }`. But it is just enough to `relation.spawn`.
* | | | | | | Remove unnecessary line break and quotesyuuji.yaginuma2018-03-301-2/+2
| |_|/ / / / |/| | | | |
* | | | | | Fix "--frozen-lockfile" argument used in yarn install rake taskGuillermo Iguaran2018-03-291-1/+1
| | | | | | | | | | | | | | | | | | --frozen-lockfile is the right name of the argument