Add hash creating in model - thanks to @alexfilatov