Skip to content

Commit 0247f30

Browse files
committed
updating instructions on private attributes
1 parent 990ee36 commit 0247f30

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,13 @@ If a model exists, but does not have a serializer it will be skipped
3535
## Extra Attributes
3636
In some cases you may want to allow attributes to be pushed to the API, but not serialized from the API. For instance
3737
you need to push `user.password`, but you shouldn't have `password` in the user serializer. To include these
38-
private attributes simply add a line like this to your serializer class:
38+
private attributes simply add a method in your seralizer called `private_attributes`
3939

4040
```ruby
41-
#push_attr password:string
42-
#push_attr password_confirmation:string
41+
def private_attributes
42+
["password:string",
43+
"password_confirmation:string"]
44+
end
4345
```
4446

4547
## Usage

0 commit comments

Comments
 (0)