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.