app/models/concerns/user_document.rb
def update_share_url
      old_path = self.path.gsub(/\/[\w\-]+\z/, "/#{self.slug_was}")
      Share.find_by(destination_path: old_path)
           .update_attribute(:destination_path, self.path)
    end
# Update the url in the 'shares' table in the database
# when slug is changed.
Update the url in the 'shares' table in the database
when slug is changed.
Update the url in the ' shares ' table in the database when slug is changed .
def update_share_url
      old_path = self.path.gsub(/\/[\w\-]+\z/, "/#{self.slug_was}")
      Share.find_by(destination_path: old_path)
           .update_attribute(:destination_path, self.path)
    end
def update_share_url old_path = self . path . gsub ( / \/ [ \w \- ]+ \z / , "/#{self.slug_was}" ) Share . find_by ( destination_path : old_path ) . update_attribute ( :destination_path , self . path ) end
Update the url in the 'shares' table in the database
when slug is changed.
Update the url in the ' shares ' table in the database when slug is changed .