Update custom id in rails ::

 Update custom id in rails ::

def update_custom_id

    self.custom_id = ("000000" + self.id.to_s).last(6)

self.save


Comments

Popular posts from this blog

Rails 7 Features :: Comparison with Rails 6 and Rails 5