-
Notifications
You must be signed in to change notification settings - Fork 1
/
models.rb
76 lines (67 loc) · 1.88 KB
/
models.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
require 'data_mapper'
require 'dm-timestamps'
class Campaign
include DataMapper::Resource
has 1, :committee
has n, :independent_expenditures
property :id, Serial
property :remote_id, String
property :name, Text
property :district, Integer
property :party, String
property :office, String
property :state, String
property :status, String
property :total_receipts, Float
property :total_contributions, Float
property :total_from_individuals, Float
property :total_from_pacs, Float
property :candidate_loans, Float
property :total_disbursements, Float
property :total_refunds, Float
property :debts_owed, Float
property :begin_cash, Float
property :end_cash, Float
property :created_at, DateTime
property :updated_at, DateTime
end
class IndependentExpenditure
include DataMapper::Resource
belongs_to :committee, :required => false
belongs_to :campaign
property :id, Serial
property :amount, Float
property :payee, Text
property :support_or_oppose, String
property :purpose, Text
property :transaction_id, String
property :date_received, Date
property :created_at, DateTime
property :updated_at, DateTime
end
class Committee
include DataMapper::Resource
belongs_to :campaign, :required => false
has n, :independent_expenditures
property :id, Serial
property :remote_id, String
property :name, Text
property :state, String
property :district, Integer
property :party, String
property :super_pac, Boolean
property :sponsor_name, Text
property :filing_frequency, String
property :interest_group, String
property :committee_type, String
property :designation, String
property :total_receipts, Float
property :total_contributions, Float
property :total_from_individuals, Float
property :total_from_pacs, Float
property :candidate_loans, Float
property :total_disbursements, Float
property :debts_owed, Float
property :begin_cash, Float
property :end_cash, Float
end