Skip to content

Instantly share code, notes, and snippets.

@mynameisrufus
Created May 29, 2012 10:06
Show Gist options
  • Save mynameisrufus/2823849 to your computer and use it in GitHub Desktop.
Save mynameisrufus/2823849 to your computer and use it in GitHub Desktop.
Using AR dirty to log changes from a controller
@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