We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 14b6bca commit 1670420Copy full SHA for 1670420
lib/tasks/news.rake
@@ -54,8 +54,8 @@ namespace :news do
54
55
# 新しいアイテムのみに ID を割り当て(古い順)
56
created_items.sort_by! { Time.parse it['published_at'] }
57
- created_items.each_with_index do |item, index|
58
- item['id'] = existing_max_id + index + 1
+ created_items.each.with_index(1) do |item, index|
+ item['id'] = existing_max_id + index
59
end
60
61
# URL をキーに、更新されなかった既存の YAML データを取得・保持
0 commit comments