rails 4 compatibility
Merge branch 'rails4'