Update Rails to version 4.1.2
Refactor TokenValidator to reduce code duplication