Lk 1299 update to rails 4 1

ideally should work with all rails versions