Fix #951
Rails 4 fix for #951