Generating a code failed on afterr_save call back on rails
<p>I am trying to adding a unique value in a table column when the record is saved. </p>

<p>Assume my table have 3 fields : &lt; Job_Code >  </p>

<p>In my POST request I send the following payload :<br>
{ "customer_id":"123", "customer_name":"Jay"} </p>

<p>If this record is saved to the database. Then I need to update the <code>Job_Code</code> column in using generated code like <code>JOB_123_458</code> where 458 is the unique id for the record. </p>

<p>I am tying to using the <code>after_save</code> callback on Active Class and update the new value on it. </p>

<p>I am using the following way : </p>

<pre><code>after_save :update_job_code

def update_job_code
   update_column(:job_code, "JOB_" + :customer_id + "_" + :id)
end
</code></pre>

<p>But I could not able to generate a Job code in the format of <code>JOB_&lt;Customer_id&gt;_&lt;Newly Created Job Id&gt;</code> </p>

<p>Let me know how do i generate the job code in relevant format in Active Record <code>after_save</code> call back</p>