mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
[ci skip] Add :private option to delegate section in guide
This commit is contained in:
parent
57a9661a9c
commit
34a10e0c41
1 changed files with 8 additions and 0 deletions
|
@ -779,6 +779,14 @@ delegate :size, to: :attachment, prefix: :avatar
|
|||
|
||||
In the previous example the macro generates `avatar_size` rather than `size`.
|
||||
|
||||
The option `:private` changes methods scope:
|
||||
|
||||
```ruby
|
||||
delegate :date_of_birth, to: :profile, private: true
|
||||
```
|
||||
|
||||
The delegated methods are public by default. Pass `private: true` to change that.
|
||||
|
||||
NOTE: Defined in `active_support/core_ext/module/delegation.rb`
|
||||
|
||||
#### `delegate_missing_to`
|
||||
|
|
Loading…
Reference in a new issue