Pastable version of Rails Security module refactoring