Skip to content

Commit cd13280

Browse files
author
Matt Swanson
committed
Set nil entry_id's to story permalinks. closes stringer-rss#264
1 parent 948b187 commit cd13280

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class UpdateNilEntryIds < ActiveRecord::Migration
2+
def up
3+
Story.where(entry_id: nil).each do |story|
4+
story.entry_id = story.permalink || story.id
5+
story.save
6+
end
7+
end
8+
9+
def self.down
10+
#skip
11+
end
12+
end

0 commit comments

Comments
 (0)