campaign_cash 2.4 → 2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -163,7 +163,7 @@ module CampaignCash
|
|
163
163
|
def unamended_filings(cycle=CURRENT_CYCLE, offset=nil)
|
164
164
|
reply = Base.invoke("#{cycle}/committees/#{id}/filings",{:offset => offset})
|
165
165
|
results = reply['results'].select{|f| f['amended'] == false}
|
166
|
-
results.map{|c| Filing.create(c)}
|
166
|
+
results.map{|c| Filing.create(c, name=self.name)}
|
167
167
|
end
|
168
168
|
|
169
169
|
end
|
data/lib/campaign_cash/filing.rb
CHANGED
@@ -9,9 +9,8 @@ module CampaignCash
|
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
|
-
def self.create(params={})
|
13
|
-
self.new :
|
14
|
-
:date_coverage_from => date_parser(params['date_coverage_from']),
|
12
|
+
def self.create(params={}, name=nil)
|
13
|
+
self.new :date_coverage_from => date_parser(params['date_coverage_from']),
|
15
14
|
:date_coverage_to => date_parser(params['date_coverage_to']),
|
16
15
|
:committee => parse_committee(params['committee']),
|
17
16
|
:report_title => params['report_title'].strip,
|
@@ -22,13 +21,14 @@ module CampaignCash
|
|
22
21
|
:original_uri => params['original_uri'],
|
23
22
|
:paper => params['paper'],
|
24
23
|
:form_type => params['form_type'],
|
25
|
-
:filing_id => params['
|
24
|
+
:filing_id => params['id'],
|
26
25
|
:committee_type => Committee.get_committee_type(params['committee_type']),
|
27
|
-
:committee_name => params['
|
26
|
+
:committee_name => params['name'],
|
28
27
|
:receipts_total => params['receipts_total'],
|
29
28
|
:contributions_total => params['contributions_total'],
|
30
29
|
:disbursements_total => params['disbursements_total'],
|
31
|
-
:cash_on_hand => params['cash_on_hand']
|
30
|
+
:cash_on_hand => params['cash_on_hand'],
|
31
|
+
:is_amendment => params['is_amendment']
|
32
32
|
end
|
33
33
|
|
34
34
|
def self.today(offset=nil)
|
@@ -74,12 +74,12 @@ class TestCampaignCash::TestCandidate < Test::Unit::TestCase
|
|
74
74
|
end
|
75
75
|
|
76
76
|
context "state candidates" do
|
77
|
-
should "return
|
78
|
-
assert_equal Candidate.state('RI', nil, nil, 2010).size,
|
77
|
+
should "return 32 total candidates from Rhode Island" do
|
78
|
+
assert_equal Candidate.state('RI', nil, nil, 2010).size, 32
|
79
79
|
end
|
80
80
|
|
81
|
-
should "return
|
82
|
-
assert_equal Candidate.state('RI', "house", nil, 2010).size,
|
81
|
+
should "return 29 House candidates from Rhode Island" do
|
82
|
+
assert_equal Candidate.state('RI', "house", nil, 2010).size, 29
|
83
83
|
end
|
84
84
|
|
85
85
|
should "return least 3 Senate candidates from Rhode Island" do
|
metadata
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: campaign_cash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: "2.
|
8
|
+
- 5
|
9
|
+
version: "2.5"
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Derek Willis
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2012-
|
17
|
+
date: 2012-11-15 00:00:00 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: json
|