Skip to content

Instantly share code, notes, and snippets.


German Antsiferov mr-dxdy

View GitHub Profile
View gist:e20df16e0ee0c7c040ba
# .gitconfig
co = checkout
ci = commit
st = status
br = branch
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
type = cat-file -t
dump = cat-file -p
mr-dxdy / gist:9480871
Created March 11, 2014 07:03
How to get the current_user in a model observer? Solution!
View gist:9480871
# install devise
# rails generate devise user
# rails g scaffold task name:string description:text
class ApplicationController < ActionController::Base
before_filter :authenticate_user!
around_filter :set_current_user_for_thread