| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | | | | | |
|
|/ / / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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]
```
|
|\ \ \ \ \
| |/ / / /
|/| | | |
| | | | |
| | | | | |
darren987469/fix-header-setting-doc-in-testing-guide
Fix header setting doc in testing guide [ci skip]
|
|/ / / / |
|
|\ \ \ \
| | | | |
| | | | | |
Update coffeelint to 2.1.0
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
There was a warning when running `npm install` in Action View:
coffee-script@1.11.1: CoffeeScript on NPM has moved to
"coffeescript" (no hyphen)
We are not requiring `coffee-script` explicitly, but `coffeelint` does.
The latest version, 2.1.0, already fix the dependency package name, so
we should upgrade to it to suppress the warning.
|
|\ \ \ \
| | | | |
| | | | | |
Update "Active Record Migrations" guide [ci skip]
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
- 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
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Context https://github.com/rails/rails/pull/33563#discussion_r208891486.
Follow up #33563
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Add Purpose Metadata to Cookies
|
|/ / / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Purpose metadata prevents cookie values from being
copy-pasted and ensures that the cookie is used only
for its originally intended purpose.
The Purpose and Expiry metadata are embedded inside signed/encrypted
cookies and will not be readable on previous versions of Rails.
We can switch off purpose and expiry metadata embedded in
signed and encrypted cookies using
config.action_dispatch.use_cookies_with_metadata = false
if you want your cookies to be readable on older versions of Rails.
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
Add changelog entry for #31503 [ci skip]
|
|/ / / /
| | | |
| | | |
| | | | |
Related to #31503
|
|\ \ \ \
| | | | |
| | | | | |
Document best practices with old migrations
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
ActiveRecord Guide - sqlite3 foreign keys note
|
| | | | | | |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
`bundle binstubs bundler` should be executed after `bundle install`
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Fixes:
`bundle binstubs bundler` doesn't generate `bin/bundle` for newly
generated Rails app.
```
...
(snip)
run bundle binstubs bundler
The git source https://github.com/rails/web-console.git is not yet checked out.
Please run `bundle install` before trying to start your application
run bundle install
Fetching https://github.com/rails/web-console.git
(snip)
...
```
Related to #33202
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Use strings instead of symbols on calls to decorate_matching_attribute_types
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
The first thing this method does is run on the argument. This change passes
in a string so we don't allocate a bunch of unnecessary extra strings by
calling to_s on a symbol over and over.
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
Fix test failure
|
| | |/ / / / / /
| |/| | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
```
...
(snip)
............F
Failure:
JsonSerializationTest#test_as_json_should_return_a_hash_if_include_root_
in_json_is_true [/home/travis/build/rails/rails/activemodel/test/cases/serializers/json_serialization_test.rb:145]:
Expected: 2006-08-01 00:00:00 UTC
Actual: "2006-08-01T00:00:00.000Z"
rails test home/travis/build/rails/rails/activemodel/test/cases/serializers/json_serialization_test.rb:136
(snip)
...
```
Related to #31503
|
|\ \ \ \ \ \ \ \
| |/ / / / / / /
|/| | | | | | | |
Make active job name prefix static since Rails.env will always be the same
|
|/ / / / / / / |
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Fix AM::Serializers::JSON#as_json method for timestamps
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
According to doc the method should return
non-json compatible types as strings.
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
Bundler binstubs
|
| | | | | | | | | |
|
| | | | | | | | | |
|
| | | | | | | | | |
|
|\ \ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
bogdanvlviv/ensure-load_schema-does_not-output-in-parallel-tests-execution
Ensure that running tests in parallel doesn't display schema load output
|
| | |_|_|_|_|_|/ /
| |/| | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
https://github.com/rails/rails/pull/33479 changed `#load_schema` to
prevent displaying schema load on running tests in parallel.
We should test this in order to prevent any regression in the future.
Context https://github.com/rails/rails/pull/33479#discussion_r206870727
|
| | | | | | | | | |
|
| |_|_|/ / / / /
|/| | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Closes #33292.
[Andrei Makarov & George Claghorn]
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
fixes #27157 CSRF protection documentation
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
* removed reference to GET requests where it applies also to other HTTP verbs
* updated documentation to try and better explain how CSRF protection
works with XHR, and the potential exposure with CORS
|
| |_|_|_|_|_|/ /
|/| | | | | | | |
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
perform_or_enqueue instead of enqueue_or_perform
|
| | |_|_|_|/ / /
| |/| | | | | | |
|
| | | | | | | | |
|
| | | | | | | | |
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
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.
|
|\ \ \ \ \ \ \ \
| |/ / / / / / /
|/| | | | | | | |
Avoid i18n 1.1.0 for now
|
|/ / / / / / /
| | | | | | |
| | | | | | |
| | | | | | | |
[Yasuo Honda & lsylvester]
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
saveriomiroddi/sav-correct_updated_at_guide_explanation
ActiveRecord Basics guide: correct explanation of the `updated_at` logic [ci skip]
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
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).
|
|\ \ \ \ \ \ \ \
| |_|_|/ / / / /
|/| | | | | | | |
Fix the obvious typos detected by github.com/client9/misspell
|
| | | | | | | | |
|
|/ / / / / / / |
|