ActiveRecord extension for type casting serialized attributes