Fix method createUrl and fix ActiveRecord not allow null