Update README.md [ci skip]
Clarify that versions call is on an instance not the class
This commit is contained in:
parent
15a94ac3e8
commit
60e5d9cbd0
|
@ -363,7 +363,7 @@ You can find out whether a model instance is the current, live one -- or whether
|
||||||
If your `ApplicationController` has a `current_user` method, PaperTrail will store the value it returns in the `version`'s `whodunnit` column. Note that this column is a string so you will have to convert it to an integer if it's an id and you want to look up the user later on:
|
If your `ApplicationController` has a `current_user` method, PaperTrail will store the value it returns in the `version`'s `whodunnit` column. Note that this column is a string so you will have to convert it to an integer if it's an id and you want to look up the user later on:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
>> last_change = Widget.versions.last
|
>> last_change = widget.versions.last
|
||||||
>> user_who_made_the_change = User.find last_change.whodunnit.to_i
|
>> user_who_made_the_change = User.find last_change.whodunnit.to_i
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue