Fixed for Rails 4.1 and Ruby 2.1

I use Rails 4.1 and Ruby 2.1. In each's block 'type' is String, but if in another verion RoR Ruby 'type' is Symbol then convert 'type' to String in both.
Merge pull request #731 from shved270189/patch-1

Fixed for Rails 4.1 and Ruby 2.1