Created
May 29, 2012 10:06
-
-
Save mynameisrufus/2823849 to your computer and use it in GitHub Desktop.
Using AR dirty to log changes from a controller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@foo.attributes = params[:foo] | |
if @foo.changed? | |
@foo.changes.each do |change| | |
# do something with the current_user | |
end | |
end | |
@foo.save |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment