rails 4 fix

Fixes issue #36  for rails 4 support