Skip to content

Commit c05bcf6

Browse files
committed
[LH345] corrections to migraiton repairing slashed paths
1 parent a64c7fe commit c05bcf6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

db/migrate/20100705083859_browsercms_3_2_0.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ def self.up
3131

3232
to_fix.each do |fix_page|
3333
# using sql updates to prevent unwanted callbacks
34-
new_path = fix_path.path.to_s.sub(/(.+)\/+$/, '\1')
34+
new_path = fix_page.path.to_s.sub(/(.+)\/+$/, '\1')
3535
execute "UPDATE pages SET path = '#{new_path}' WHERE id = #{fix_page.id};"
3636
# update the current version record to
37-
execute "UPDATE page_versions SET path = '#{new_path}' WHERE page_id = #{fix_page.id}} AND version = #{fix_page.version};"
37+
execute "UPDATE page_versions SET path = '#{new_path}' WHERE page_id = #{fix_page.id} AND version = #{fix_page.version};"
3838

3939
# now update any newer versions whose paths are currupted. For each currupt path, set it
4040
# to the most recent earlier valid path, or the new stripped path

0 commit comments

Comments
 (0)