update article path when username is changed (#626)
This commit is contained in:
parent
ff9d2c7f7a
commit
e0b7df7fc5
1 changed files with 4 additions and 0 deletions
|
|
@ -385,6 +385,10 @@ class User < ApplicationRecord
|
|||
c.slug = c.slug.gsub(username_was, username)
|
||||
c.save
|
||||
end
|
||||
articles.find_each do |a|
|
||||
a.path = a.path.gsub(username_was, username)
|
||||
a.save
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue