1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Add backticks [ci-skip]

This commit is contained in:
Jonathan Hefner 2022-02-09 11:50:00 -06:00
parent 4ae7acf00d
commit a84788e117
4 changed files with 13 additions and 13 deletions

View file

@ -379,7 +379,7 @@ Your application has a session for each user in which you can store small amount
* [`ActionDispatch::Session::CookieStore`][] - Stores everything on the client.
* [`ActionDispatch::Session::CacheStore`][] - Stores the data in the Rails cache.
* `ActionDispatch::Session::ActiveRecordStore` - Stores the data in a database using Active Record (requires the `activerecord-session_store` gem).
* [`ActionDispatch::Session::MemCacheStore`][] - Stores the data in a memcached cluster (this is a legacy implementation; consider using CacheStore instead).
* [`ActionDispatch::Session::MemCacheStore`][] - Stores the data in a memcached cluster (this is a legacy implementation; consider using `CacheStore` instead).
All session stores use a cookie to store a unique ID for each session (you must use a cookie, Rails will not allow you to pass the session ID in the URL as this is less secure).

View file

@ -1325,7 +1325,7 @@ time_range = (Time.now.midnight - 1.day)..Time.now.midnight
Customer.joins(:orders).where(orders: { created_at: time_range }).distinct
```
For more advanced conditions or to reuse an existing named scope, `Relation#merge` may be used. First, let's add a new named scope to the Order model:
For more advanced conditions or to reuse an existing named scope, `Relation#merge` may be used. First, let's add a new named scope to the `Order` model:
```ruby
class Order < ApplicationRecord

View file

@ -257,9 +257,9 @@ INFO. Additional keys may be added by the caller.
#### unpermitted_parameters.action_controller
| Key | Value |
| ------------- | --------------------------------------------------------------------- |
| ------------- | ----------------------------------------------------------------------------- |
| `:keys` | The unpermitted keys |
| `:context` | Hash with the following keys: :controller, :action, :params, :request |
| `:context` | Hash with the following keys: `:controller`, `:action`, `:params`, `:request` |
### Action Dispatch
@ -420,11 +420,11 @@ INFO. The adapters will add their own data as well.
#### cache_read.active_support
| Key | Value |
| ------------------ | ------------------------------------------------- |
| ------------------ | --------------------------------------------------- |
| `:key` | Key used in the store |
| `:store` | Name of the store class |
| `:hit` | If this read is a hit |
| `:super_operation` | :fetch is added when a read is used with `#fetch` |
| `:super_operation` | `:fetch` is added when a read is used with `#fetch` |
#### cache_generate.active_support

View file

@ -206,7 +206,7 @@ $ bin/rails generate scaffold User name:string
create test/system/users_test.rb
```
Looking at this output, it's easy to understand how generators work in Rails 3.0 and above. The scaffold generator doesn't actually generate anything; it just invokes others to do the work. This allows us to add/replace/remove any of those invocations. For instance, the scaffold generator invokes the scaffold_controller generator, which invokes erb, test_unit and helper generators. Since each generator has a single responsibility, they are easy to reuse, avoiding code duplication.
Looking at this output, it's easy to understand how generators work in Rails 3.0 and above. The scaffold generator doesn't actually generate anything; it just invokes others to do the work. This allows us to add/replace/remove any of those invocations. For instance, the scaffold generator invokes the `scaffold_controller` generator, which invokes `erb`, `test_unit` and `helper` generators. Since each generator has a single responsibility, they are easy to reuse, avoiding code duplication.
The next customization on the workflow will be to stop generating stylesheet and test fixture files for scaffolds altogether. We can achieve that by changing our configuration to the following: