Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download all forms for last 14 days #99

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions app/lib/disclosure_downloader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ def download
puts "Syncing new filing: #{filing.inspect}"
end

break if latest && latest == filing
break if Date.today - filing.filed_at.to_date > 14

download_filing(filing)
download_filing(filing) if filing.new_record?
filing.save

# If the filing was amended, but we haven't downloaded the original
# un-amended filing yet, let's grab it now.
Expand Down
2 changes: 1 addition & 1 deletion app/lib/forms.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def self.from_filings(filing_array)
Forms::BaseForm.new(filing, name: '803')
when 115
Forms::BaseForm.new(filing, name: 'SFEC 161')
when 199, 215, 220, 228, 254
when 7, 199, 215, 220, 228, 254
Forms::Form700.new(filing, name: '700')
when 236 # LBQ = Oakland Lobbyist Quartery Report
Forms::BaseForm.new(filing, name: 'LBQ')
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/disclosure_downloader_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def fetch_transaction_contents(id)
filerStateId: "1111",
filerName: 'Foo bar for Mayor',
title: "title",
filingDate: "2022-10-12T17:50:07.0000000-07:00",
filingDate: "#{Date.today - 1}T17:50:07.0000000-07:00",
amendmentSequenceNumber: 0,
amendedFilingId: nil,
form: 36, # FPPC Form 496
Expand Down