aboutsummaryrefslogtreecommitdiffstats
path: root/guides
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #33621 from sikachu/sikachu-guide-rubocopRichard Schneeman2018-08-191-2/+13
|\ | | | | Update guide to mention code linters available
| * Update guide to mention code linters availablePrem Sichanugrist2018-08-151-2/+13
| | | | | | | | | | | | | | Contributors can run RuboCop locally to catch code style error in Ruby code and npm lint task for `rails-ujs` CoffeeScript and JavaScript code. [skip ci]
* | DRY in Active Record Query Interface [ci skip]bogdanvlviv2018-08-191-16/+0
| | | | | | | | | | | | | | | | | | | | | | The sentence "This is exactly the same as defining a class method ..." is not true, so #33653 fixed it, but added changes repeat what is explained a few lines below. We can remove this part since a user is able to get info about the difference between scopes and class methods below. Context https://github.com/rails/rails/pull/33653#discussion_r211105969. Reverts #33653, 97feb4996b1c88f770101dfce6d4d3a6baf6bb33.
* | Fix syntax error in the doc [ci skip]Ryuta Kamizono2018-08-191-1/+1
| |
* | Merge pull request #33653 from LemonAndroid/patch-1Richard Schneeman2018-08-191-3/+9
|\ \ | | | | | | Explained difference between scope & class method
| * | Explained difference between scope & class methodLemonAndroid2018-08-191-3/+9
| | |
* | | Update `google-cloud-storage` gem version [ci skip]yuuji.yaginuma2018-08-191-1/+1
|/ / | | | | | | Now requires version 1.11 or newer. Ref: bf5f41d948b6f3f27db7fdc2b70897aec991065f
* | Enable Style/ParenthesesAroundCondition copRyuta Kamizono2018-08-191-2/+2
| | | | | | | | To prevent style check in review like https://github.com/rails/rails/pull/33608#discussion_r211087605.
* | [skip ci] Fix overlapping text in the guideArye Dov Eidelman2018-08-171-1/+5
| | | | | | | | Fix a layout issue in the rails guides, where the navigation covers the main text, if the page is between 800 and 960 pixels wide. (issue #33406)
* | Merge pull request #33537 from ↵Ryuta Kamizono2018-08-171-0/+15
|\ \ | | | | | | | | | | | | | | | ZASMan/update_action_mailer_docs_custom_view_paths Add note for custom mailer view paths in action mailer guide. [ci skip]
| * | Add note for custom mailer view paths in action mailer guide. [ci skip]Zane2018-08-161-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds stuff Fixes a typo Integrates changes Adds link to append_view_path in actionmailer guide.
* | | Harmonize shell commands in dev guide [ci skip]Anton Rieder2018-08-161-7/+7
| |/ |/|
* | Add `Array#extract!`bogdanvlviv2018-08-141-0/+13
| | | | | | | | | | | | | | | | | | | | | | The method removes and returns the elements for which the block returns a true value. If no block is given, an Enumerator is returned instead. ``` numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] odd_numbers = numbers.extract! { |number| number.odd? } # => [1, 3, 5, 7, 9] numbers # => [0, 2, 4, 6, 8] ```
* | Fix header setting doc in testing guide [ci skip]Darren2018-08-131-3/+2
| |
* | Clarify "Old Migrations" in "Active Record Migrations" guide [ci skip]bogdanvlviv2018-08-121-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | - Name rails app' files relatively to its root - `structure.sql` => `db/structure.sql` - `schema.rb` => `db/schema.rb` - Clarify rails commands - `db:migrate` => `rails db:migrate` - `db:migrate:status` => `rails db:migrate:status` - Add `/` to the end of `db/migrate` in order to express that it is directory and to keep consistency with `db/migrate/` above. Follow up #33474
* | Clarify note that SQLite3 adapter doesn't support `add_foreign_key` [ci skip]bogdanvlviv2018-08-121-3/+2
| | | | | | | | | | | | Context https://github.com/rails/rails/pull/33563#discussion_r208891486. Follow up #33563
* | Merge pull request #33474 from olivierlacan/old-migrationsRichard Schneeman2018-08-111-3/+22
|\ \ | | | | | | Document best practices with old migrations
| * | Document best practices with old migrationsOlivier Lacan2018-08-031-3/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The copy here is of course up for discussion but it feels like we need to address the issue of old migrations in the Migration guide because other than mentioning the canonical nature of schema.rb/structure.sql or the actual database compared to migration files, it seems like more guidance would help. Here's a sample of the kinds of question people seem to often ask about old Rails migrations: - https://stackoverflow.com/questions/20119391/delete-old-migrations-files-in-a-rails-app - https://www.reddit.com/r/rails/comments/4ayosd/compacting_migrations_files_or_delete_them/ - https://stackoverflow.com/questions/4248682/is-it-a-good-idea-to-purge-old-rails-migration-files - https://stackoverflow.com/questions/707013/is-it-a-good-idea-to-collapse-old-rails-migrations - https://stackoverflow.com/questions/1981777/rails-remove-old-models-with-migrations - https://stackoverflow.com/questions/3343534/rebase-rails-migrations-in-a-long-running-project The common theme seems to be: "I've got old migrations, should I keep them around on an old project?". My personal stance is that as long as migrations run and don't take too long do so, you should keep them around since it allows people working on the Rails project with you to seamlessly upgrade their local development database without having to do a `db:drop db:schema:load` and lose all their seed data. While writing down this suggested new section it felt like I was describing a very cumbersome process that could be address with a rake task like: ```bash rails db:migrate:remove VERSION=20121201123456 ``` It rollback to the version just before `20121201123456`, delete the migration file, and run `db:migrate` to get back to the latest migration. This of course doesn't address a situation when someone would want to delete or merge all migrations prior to a certain date, which is addressed by [squasher](https://github.com/jalkoby/squasher). I'm not sure this is something we want to encourage people to do. Although I feel like with more and more production Rails apps over 5-years old, it's definitely a concern we should address.
* | | Merge pull request #33563 from lzap/foreign-key-note-docRichard Schneeman2018-08-111-0/+4
|\ \ \ | | | | | | | | ActiveRecord Guide - sqlite3 foreign keys note
| * | | ActiveRecord Guide - sqlite3 foreign keys noteLukas Zapletal2018-08-091-0/+4
| | | |
* | | | Add missing instructions for FreeBSD [ci skip]Robin Dupret2018-08-091-10/+18
|/ / / | | | | | | | | | | | | | | | | | | | | | The development dependencies installation guides have the installation instructions for FreeBSD in other sections so let's be consistent regarding the dependencies for Active Storage setup. Also fix a few typos.
* | | Merge pull request #33554 from ↵Eileen M. Uchitelle2018-08-081-1/+1
|\ \ \ | |_|/ |/| | | | | | | | saveriomiroddi/sav-correct_updated_at_guide_explanation ActiveRecord Basics guide: correct explanation of the `updated_at` logic [ci skip]
| * | ActiveRecord Basics guide: correct explanation of the `updated_at` logic [ci ↵Saverio Miroddi2018-08-081-1/+1
| | | | | | | | | | | | | | | | | | skip] It's misleanding/incorrect to state that `updated_at` is set on updates, since creation != update (and the column is actually set on creation, too).
* | | Add lambdas in conditional validationsAna María Martínez Gómez2018-08-071-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | As `Lambdas` are a type of `Proc`, they can also be used in the `if`/`unless` option of a validation to decide when the validation is executed. Add this case to the guide for clarification. Closes https://github.com/rails/rails/issues/33212
* | | Merge pull request #33507 from jackc/patch-1George Claghorn2018-08-031-1/+1
|\ \ \ | | | | | | | | Fix file upload location recommendation
| * | | Fix file upload location recommendationJack Christensen2018-08-011-1/+1
| | | | | | | | | | | | Going one level downwards from Rails' /public directory would still be inside the public directory and therefore servable by the web server. Files should stored upwards of the public directory.
* | | | Merge pull request #33452 from thetizzo/rails_32_to_40_doc_updateGeorge Claghorn2018-08-031-0/+11
|\ \ \ \ | | | | | | | | | | [Documentation] Mention default HTTP headers in Rails 3.2 to 4.0 upgrade guide
| * | | | Update Rails 3.2 to 4.0 upgrade guide to include a mention and tip for ↵thetizzo2018-08-031-0/+11
| | | | | | | | | | | | | | | | | | | | handling the addition of configurable default HTTP headers. [ci skip]
* | | | | [ci skip] Update adding member routes guide to fix inconsistency with the ↵Ryan Brooks2018-08-031-1/+1
| |/ / / |/| | | | | | | | | | | implementation. Closes #33518
* | | | Revert "Remove label 'work in progress' for AM and AV guides"Xavier Noria2018-07-311-0/+2
| | | |
* | | | Merge pull request #31883 from ↵Richard Schneeman2018-07-311-2/+0
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | bogdanvlviv/remove-label-in-porgress-for-M-V-guides Remove label 'work in progress' for AM and AV guides
| * | | | Remove label 'work in progress' for AM and AV guidesbogdanvlviv2018-02-041-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've reviewed "Active Model Basics" and "Action View Overview" guides and looks like they have good enough information and don't have errors. This commit removes label 'work in progress' for these guides.
* | | | | [ci skip] Fix the outdated description for `find_each`.Aditya Kapoor2018-07-311-1/+1
| |_|_|/ |/| | |
* | | | Enable Start/EndWith and RegexpMatch copsBart de Water2018-07-284-6/+6
| | | | | | | | | | | | | | | | | | | | In cases where the MatchData object is not used, this provides a speed-up: https://github.com/JuanitoFatas/fast-ruby/#stringmatch-vs-stringmatch-vs-stringstart_withstringend_with-code-start-code-end
* | | | Merge pull request #33434 from utilum/remove_testing_guide_commentEileen M. Uchitelle2018-07-271-1/+1
|\ \ \ \ | |_|/ / |/| | | Testing Guide: unnecessary comment
| * | | Testing Guide: unnecessary commentutilum2018-07-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This has been around as far back as I can [see](https://github.com/rails/rails/blob/5137d03cc5b2a5f0820bdcf11b0fffe5bf461470/guides/source/testing.md). No need to specify the obvious. [ci skip]
* | | | AST Guide: install and migrate tasks in new apputilum2018-07-261-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | This line refers only to an upgrade situation, but same is need to setup AST in a new application. [ci skip]
* | | | Reference Active Storage instead of third-party libraries in guidePaul McMahon2018-07-261-1/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Paperclip has officially been deprecated, so we shouldn't mention it anymore. CarrierWave could still be referenced, as there are use cases where it currently makes more sense, but for simplicity, I thought removing the mention of third party libraries made sense. If we want to talk about them, listing "alternatives" within the Active Storage guide could make more sense.
* | | Merge pull request #33229 from ↵Matthew Draper2018-07-2523-263/+260
|\ \ \ | | | | | | | | | | | | | | | | albertoalmagro/albertoalmagro/prefer-rails-command-over-bin-rails Prefer rails command over bin/rails
| * | | Substitute references to task for commandAlberto Almagro2018-07-066-25/+25
| | | | | | | | | | | | | | | | This commit substitutes references to rails/rake task for rails command
| * | | Improve text readabilityAlberto Almagro2018-07-061-1/+1
| | | |
| * | | Homogenize rails commands and former rake tasksAlberto Almagro2018-07-061-58/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit integrates most used previously rake commands into the above outer list. Ordering is based on their individual predicted frequency of use. Separation between bin/rails tasks is also removed to display all commands at the same level. It also removes references to rake and tasks and substitutes them for command.
| * | | Recommend use of rails over bin/railsAlberto Almagro2018-07-0623-193/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As discussed in #33203 rails command already looks for, and runs, bin/rails if it is present. We were mixing recommendations within guides and USAGE guidelines, in some files we recommended using rails, in others bin/rails and in some cases we even had both options mixed together.
* | | | Rails guides are now served over httpsPaul McMahon2018-07-2457-80/+80
| | | | | | | | | | | | | | | | | | | | http links will be redirected to the https version, but still better to just directly link to the https version.
* | | | Merge pull request #33371 from ↵Eileen M. Uchitelle2018-07-231-1/+10
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | lanzhiheng/change-the-text-color-which-wrapped-by-code-tag [ci skip] Change the text color which wrapped by code tag.
| * | | | Change the background color which wrapped by code tag. [ci skip]lanzhiheng2018-07-191-1/+10
| | | | |
* | | | | [ci skip] fix typo in Associations guideK. Rodman Mannix2018-07-221-1/+1
|/ / / /
* | | | Add situation for belongs to association. [ci skip]lanzhiheng2018-07-181-1/+1
| | | |
* | | | Merge pull request #33364 from lanzhiheng/fix-document-in-model-validatorRyuta Kamizono2018-07-161-18/+0
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | Modify the expression's issue for `errors.add` document. [ci skip]
| * | | | Remove the invalid usage document about `errors`. [ci skip]lanzhiheng2018-07-161-18/+0
| | | | |