Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions app/models/entry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ class Entry < ApplicationRecord


def fetch_data!(inline: false)
# TODO: make this more robust, this should not be configured globally.
# Track parliament session dates for matching?
if self.published_at < Time.parse("2025-05-26")
self.skipped_at = Time.now
self.skip_reason = "Too old, published before 2025-05-26 (Carney's election)"
self.save!
return
end

unless inline
return EntryDataFetcherJob.perform_later(self)
end
Expand Down
6 changes: 6 additions & 0 deletions db/migrate/20250619212356_add_skipped_at_to_entry.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class AddSkippedAtToEntry < ActiveRecord::Migration[8.0]
def change
add_column :entries, :skipped_at, :timestamp
add_column :entries, :skip_reason, :string
end
end
4 changes: 3 additions & 1 deletion db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.