Initially comment out attr_accessible

This commit is contained in:
Eric Schultz 2019-06-21 17:12:54 -05:00 committed by Luis Castro
parent a7e5baae2c
commit f2c32fffca
No known key found for this signature in database
GPG key ID: 0A8F33D4C4E27639
39 changed files with 470 additions and 432 deletions

View file

@ -1,18 +1,19 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class BankAccount < ApplicationRecord class BankAccount < ApplicationRecord
attr_accessible \ #TODO
:name, # str (readable bank name identifier, eg. "Wells Fargo *1234") # attr_accessible \
:confirmation_token, # str (randomly generated private token for email confirmation) # :name, # str (readable bank name identifier, eg. "Wells Fargo *1234")
:account_number, # str (last digits only) # :confirmation_token, # str (randomly generated private token for email confirmation)
:bank_name, # str # :account_number, # str (last digits only)
:pending_verification, # bool (whether this bank account is still awaiting email confirmation) # :bank_name, # str
:status, # str # :pending_verification, # bool (whether this bank account is still awaiting email confirmation)
:email, # str (contact email associated with the user who created this bank account) # :status, # str
:deleted, # bool (soft delete flag) # :email, # str (contact email associated with the user who created this bank account)
:stripe_bank_account_token, # str # :deleted, # bool (soft delete flag)
:stripe_bank_account_id, # str # :stripe_bank_account_token, # str
:nonprofit_id, :nonprofit # :stripe_bank_account_id, # str
# :nonprofit_id, :nonprofit
#validates :stripe_bank_account_token, presence: true, uniqueness: true #validates :stripe_bank_account_token, presence: true, uniqueness: true
# validates :stripe_bank_account_id, presence: true, uniqueness: true # validates :stripe_bank_account_id, presence: true, uniqueness: true

View file

@ -3,13 +3,14 @@ class BillingPlan < ApplicationRecord
Names = ['Starter', 'Fundraising', 'Supporter Management'] Names = ['Starter', 'Fundraising', 'Supporter Management']
DefaultAmounts = [0, 9900, 29900] # in pennies DefaultAmounts = [0, 9900, 29900] # in pennies
attr_accessible \ #TODO
:name, #str: readable name # attr_accessible \
:tier, #int: 0-4 (0: Free, 1: Fundraising, 2: Supporter Management) # :name, #str: readable name
:amount, #int (cents) # :tier, #int: 0-4 (0: Free, 1: Fundraising, 2: Supporter Management)
:stripe_plan_id, #str (matches plan ID in Stripe) Not needed if it's not a paying subscription # :amount, #int (cents)
:interval, #str ('monthly', 'annual') # :stripe_plan_id, #str (matches plan ID in Stripe) Not needed if it's not a paying subscription
:percentage_fee # 0.038 # :interval, #str ('monthly', 'annual')
# :percentage_fee # 0.038
has_many :billing_subscriptions has_many :billing_subscriptions

View file

@ -1,11 +1,12 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class BillingSubscription < ApplicationRecord class BillingSubscription < ApplicationRecord
attr_accessible \ #TODO
:nonprofit_id, :nonprofit, # attr_accessible \
:billing_plan_id, :billing_plan, # :nonprofit_id, :nonprofit,
:stripe_subscription_id, # :billing_plan_id, :billing_plan,
:status # trialing, active, past_due, canceled, or unpaid # :stripe_subscription_id,
# :status # trialing, active, past_due, canceled, or unpaid
attr_accessor :stripe_plan_id, :manual attr_accessor :stripe_plan_id, :manual
belongs_to :nonprofit belongs_to :nonprofit

View file

@ -1,41 +1,42 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class Campaign < ApplicationRecord class Campaign < ApplicationRecord
attr_accessible \ #TODO
:name, # attr_accessible \
:tagline, # :name,
:slug, # str: url name # :tagline,
:total_supporters, # :slug, # str: url name
:goal_amount, # :total_supporters,
:nonprofit_id, # :goal_amount,
:profile_id, # :nonprofit_id,
:main_image, # :profile_id,
:remove_main_image, # for carrierwave # :main_image,
:background_image, # :remove_main_image, # for carrierwave
:remove_background_image, #bool carrierwave # :background_image,
:banner_image, # :remove_background_image, #bool carrierwave
:remove_banner_image, # :banner_image,
:published, # :remove_banner_image,
:video_url, #str # :published,
:vimeo_video_id, # :video_url, #str
:youtube_video_id, # :vimeo_video_id,
:summary, # :youtube_video_id,
:recurring_fund, # bool: whether this is a recurring campaign # :summary,
:body, # :recurring_fund, # bool: whether this is a recurring campaign
:goal_amount_dollars, #accessor: translated into goal_amount (cents) # :body,
:show_total_raised, # bool # :goal_amount_dollars, #accessor: translated into goal_amount (cents)
:show_total_count, # bool # :show_total_raised, # bool
:hide_activity_feed, # bool # :show_total_count, # bool
:end_datetime, # :hide_activity_feed, # bool
:deleted, #bool (soft delete) # :end_datetime,
:hide_goal, # bool # :deleted, #bool (soft delete)
:hide_thermometer, #bool # :hide_goal, # bool
:hide_title, # bool # :hide_thermometer, #bool
:receipt_message, # text # :hide_title, # bool
:hide_custom_amounts, # boolean # :receipt_message, # text
:parent_campaign_id, # :hide_custom_amounts, # boolean
:reason_for_supporting, # :parent_campaign_id,
:default_reason_for_supporting # :reason_for_supporting,
# :default_reason_for_supporting
validate :end_datetime_cannot_be_in_past, :on => :create validate :end_datetime_cannot_be_in_past, :on => :create
validates :profile, :presence => true validates :profile, :presence => true

View file

@ -1,11 +1,12 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class CampaignGift < ApplicationRecord class CampaignGift < ApplicationRecord
attr_accessible \ #TODO
:donation_id, # attr_accessible \
:donation, # :donation_id,
:campaign_gift_option, # :donation,
:campaign_gift_option_id # :campaign_gift_option,
# :campaign_gift_option_id
belongs_to :donation belongs_to :donation
belongs_to :campaign_gift_option belongs_to :campaign_gift_option

View file

@ -1,17 +1,18 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class CampaignGiftOption < ApplicationRecord class CampaignGiftOption < ApplicationRecord
attr_accessible \ #TODO
:amount_one_time, #int (cents) # attr_accessible \
:amount_recurring, #int (cents) # :amount_one_time, #int (cents)
:amount_dollars, #str, gets converted to amount # :amount_recurring, #int (cents)
:description, # text # :amount_dollars, #str, gets converted to amount
:name, # str # :description, # text
:campaign, #assocation # :name, # str
:quantity, #int (optional) # :campaign, #assocation
:to_ship, #boolean # :quantity, #int (optional)
:order, #int (optional) # :to_ship, #boolean
:hide_contributions #boolean (optional) # :order, #int (optional)
# :hide_contributions #boolean (optional)
belongs_to :campaign belongs_to :campaign
has_many :campaign_gifts has_many :campaign_gifts

View file

@ -1,17 +1,18 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class Card < ApplicationRecord class Card < ApplicationRecord
attr_accessible \ #TODO
:cardholders_name, # str (name associated with this card) # attr_accessible \
:email, # str (cache the email associated with this card) # :cardholders_name, # str (name associated with this card)
:name, # str (readable card name, eg. Visa *1234) # :email, # str (cache the email associated with this card)
:failure_message, # accessor for temporarily storing the stripe decline message # :name, # str (readable card name, eg. Visa *1234)
:status, # str # :failure_message, # accessor for temporarily storing the stripe decline message
:stripe_card_token, # str # :status, # str
:stripe_card_id, # str # :stripe_card_token, # str
:stripe_customer_id, # str # :stripe_card_id, # str
:holder, :holder_id, :holder_type, # polymorphic cardholder association # :stripe_customer_id, # str
:inactive # a card is inactive. This is currently only meaningful for nonprofit cards # :holder, :holder_id, :holder_type, # polymorphic cardholder association
# :inactive # a card is inactive. This is currently only meaningful for nonprofit cards
attr_accessor :failure_message attr_accessor :failure_message

View file

@ -3,11 +3,12 @@
class Charge < ApplicationRecord class Charge < ApplicationRecord
attr_accessible \ #TODO
:amount, # attr_accessible \
:fee, # :amount,
:stripe_charge_id, # :fee,
:status # :stripe_charge_id,
# :status
has_one :campaign, through: :donation has_one :campaign, through: :donation

View file

@ -1,10 +1,11 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class Comment < ApplicationRecord class Comment < ApplicationRecord
attr_accessible \ #TODO
:host_id, :host_type, #parent: Event, Campaign, nil # attr_accessible \
:profile_id, # :host_id, :host_type, #parent: Event, Campaign, nil
:body # :profile_id,
# :body
validates :profile, :presence => true validates :profile, :presence => true
validates :body, :presence => true, :length => {:maximum => 200} validates :body, :presence => true, :length => {:maximum => 200}

View file

@ -1,10 +1,11 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class CustomFieldJoin < ApplicationRecord class CustomFieldJoin < ApplicationRecord
attr_accessible \ #TODO
:supporter, :supporter_id, # attr_accessible \
:custom_field_master, :custom_field_master_id, # :supporter, :supporter_id,
:value # :custom_field_master, :custom_field_master_id,
# :value
validates :custom_field_master, presence: true validates :custom_field_master, presence: true

View file

@ -3,14 +3,15 @@ class Dispute < ApplicationRecord
Reasons = [:unrecognized, :duplicate, :fraudulent, :subscription_canceled, :product_unacceptable, :product_not_received, :unrecognized, :credit_not_processed, :goods_services_returned_or_refused, :goods_services_cancelled, :incorrect_account_details, :insufficient_funds, :bank_cannot_process, :debit_not_authorized, :general] Reasons = [:unrecognized, :duplicate, :fraudulent, :subscription_canceled, :product_unacceptable, :product_not_received, :unrecognized, :credit_not_processed, :goods_services_returned_or_refused, :goods_services_cancelled, :incorrect_account_details, :insufficient_funds, :bank_cannot_process, :debit_not_authorized, :general]
Statuses = [:needs_response, :under_review, :won, :lost, :lost_and_paid]
attr_accessible \ Statuses = [:needs_response, :under_review, :won, :lost, :lost_and_paid]
:gross_amount, # int #TODO
:charge_id, :charge, # attr_accessible \
:payment_id, :payment, # :gross_amount, # int
:status, # :charge_id, :charge,
:reason # :payment_id, :payment,
# :status,
# :reason
belongs_to :charge belongs_to :charge
belongs_to :payment belongs_to :payment

View file

@ -1,25 +1,26 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class Donation < ApplicationRecord class Donation < ApplicationRecord
attr_accessible \ #TODO
:date, # datetime (when this donation was made) # attr_accessible \
:amount, # int (in cents) # :date, # datetime (when this donation was made)
:recurring, # bool # :amount, # int (in cents)
:anonymous, # bool # :recurring, # bool
:email, # str (cached email of the donor) # :anonymous, # bool
:designation, # text # :email, # str (cached email of the donor)
:dedication, # text # :designation, # text
:comment, # text # :dedication, # text
:origin_url, # text # :comment, # text
:nonprofit_id, :nonprofit, # :origin_url, # text
:card_id, :card, # Card with which any charges were made # :nonprofit_id, :nonprofit,
:supporter_id, :supporter, # :card_id, :card, # Card with which any charges were made
:profile_id, :profile, # :supporter_id, :supporter,
:campaign_id, :campaign, # :profile_id, :profile,
:payment_id, :payment, # :campaign_id, :campaign,
:event_id, :event, # :payment_id, :payment,
:direct_debit_detail_id, :direct_debit_detail, # :event_id, :event,
:payment_provider # :direct_debit_detail_id, :direct_debit_detail,
# :payment_provider
validates :amount, presence: true, numericality: { only_integer: true } validates :amount, presence: true, numericality: { only_integer: true }
validates :supporter, presence: true validates :supporter, presence: true

View file

@ -1,12 +1,12 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class EmailDraft < ApplicationRecord class EmailDraft < ApplicationRecord
#TODO
attr_accessible \ # attr_accessible \
:nonprofit, :nonprofit_id, # :nonprofit, :nonprofit_id,
:name, # :name,
:deleted, # :deleted,
:value, # :value,
:created_at # :created_at
belongs_to :nonprofit belongs_to :nonprofit

View file

@ -1,14 +1,15 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class EmailSetting < ApplicationRecord class EmailSetting < ApplicationRecord
attr_accessible \ #TODO
:user_id, :user, # attr_accessible \
:nonprofit_id, :nonprofit, # :user_id, :user,
:notify_payments, # :nonprofit_id, :nonprofit,
:notify_campaigns, # :notify_payments,
:notify_events, # :notify_campaigns,
:notify_payouts, # :notify_events,
:notify_recurring_donations # :notify_payouts,
# :notify_recurring_donations
belongs_to :nonprofit belongs_to :nonprofit
belongs_to :user belongs_to :user

View file

@ -1,38 +1,39 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class Event < ApplicationRecord class Event < ApplicationRecord
attr_accessible \ #TODO
:deleted, #bool for soft-delete # attr_accessible \
:name, # str # :deleted, #bool for soft-delete
:tagline, # str # :name, # str
:summary, # text # :tagline, # str
:body, # text (html) # :summary, # text
:end_datetime, # :body, # text (html)
:start_datetime, # :end_datetime,
:latitude, # float # :start_datetime,
:longitude, # float # :latitude, # float
:location, # str # :longitude, # float
:city, # str # :location, # str
:state_code, # str # :city, # str
:address, # str # :state_code, # str
:zip_code, # str # :address, # str
:main_image, # str # :zip_code, # str
:remove_main_image, # for carrierwave # :main_image, # str
:background_image, # str # :remove_main_image, # for carrierwave
:remove_background_image, # bool carrierwave # :background_image, # str
:published, # bool # :remove_background_image, # bool carrierwave
:slug, # str # :published, # bool
:directions, # text # :slug, # str
:venue_name, # str # :directions, # text
:profile_id, # creator # :venue_name, # str
:ticket_levels_attributes, # :profile_id, # creator
:show_total_raised, # bool # :ticket_levels_attributes,
:show_total_count, # bool # :show_total_raised, # bool
:hide_activity_feed, # bool # :show_total_count, # bool
:nonprofit_id, # host # :hide_activity_feed, # bool
:hide_title, # bool # :nonprofit_id, # host
:organizer_email, # string # :hide_title, # bool
:receipt_message # text # :organizer_email, # string
# :receipt_message # text
validates :name, :presence => true validates :name, :presence => true
validates :end_datetime, :presence => true validates :end_datetime, :presence => true

View file

@ -1,10 +1,11 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class EventDiscount < ApplicationRecord class EventDiscount < ApplicationRecord
attr_accessible \ #TODO
:code, # attr_accessible \
:event_id, # :code,
:name, # :event_id,
:percent # :name,
# :percent
belongs_to :event belongs_to :event
has_many :tickets has_many :tickets

View file

@ -1,19 +1,20 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class FullContactInfo < ApplicationRecord class FullContactInfo < ApplicationRecord
attr_accessible \ #TODO
:email, # attr_accessible \
:full_name, # :email,
:gender, # :full_name,
:city, # :gender,
:county, # :city,
:state_code, # :county,
:country, # :state_code,
:continent, # :country,
:age, # :continent,
:age_range, # :age,
:location_general, # :age_range,
:supporter_id, :supporter, # :location_general,
:websites # :supporter_id, :supporter,
# :websites
has_many :full_contact_photos has_many :full_contact_photos
has_many :full_contact_social_profiles has_many :full_contact_social_profiles

View file

@ -1,15 +1,16 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class FullContactOrg < ApplicationRecord class FullContactOrg < ApplicationRecord
attr_accessible \ #TODO
:name, # attr_accessible \
:is_primary, # :name,
:name, # :is_primary,
:start_date, # :name,
:end_date, # :start_date,
:title, # :end_date,
:current, # :title,
:full_contact_info_id, :full_contact_info # :current,
# :full_contact_info_id, :full_contact_info
belongs_to :full_contact_info belongs_to :full_contact_info

View file

@ -1,11 +1,12 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class FullContactPhoto < ApplicationRecord class FullContactPhoto < ApplicationRecord
attr_accessible \ #TODO
:full_contact_info, # attr_accessible \
:full_contact_info_id, # :full_contact_info,
:type_id, # i.e. twitter, linkedin, facebook # :full_contact_info_id,
:is_primary, #bool # :type_id, # i.e. twitter, linkedin, facebook
:url #string # :is_primary, #bool
# :url #string
belongs_to :full_contact_info belongs_to :full_contact_info

View file

@ -1,13 +1,14 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class FullContactSocialProfile < ApplicationRecord class FullContactSocialProfile < ApplicationRecord
attr_accessible \ #TODO
:full_contact_info, # attr_accessible \
:full_contact_info_id, # :full_contact_info,
:type_id, # i.e. twitter, linkedin, facebook # :full_contact_info_id,
:username, #string # :type_id, # i.e. twitter, linkedin, facebook
:uid, # string # :username, #string
:bio, #string # :uid, # string
:url #string # :bio, #string
# :url #string
belongs_to :full_contact_info belongs_to :full_contact_info

View file

@ -1,10 +1,11 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class FullContactTopic < ApplicationRecord class FullContactTopic < ApplicationRecord
attr_accessible \ #TODO
:provider, # attr_accessible \
:value, # :provider,
:full_contact_info_id, :full_contact_info # :value,
# :full_contact_info_id, :full_contact_info
belongs_to :full_contact_info belongs_to :full_contact_info

View file

@ -1,13 +1,14 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class Import < ApplicationRecord class Import < ApplicationRecord
attr_accessible \ #TODO
:user_id, :user, # attr_accessible \
:email, # email of the user who ma # :user_id, :user,
:nonprofit_id, :nonprofit, # :email, # email of the user who ma
:row_count, # :nonprofit_id, :nonprofit,
:imported_count, # :row_count,
:date # :imported_count,
# :date
has_many :supporters has_many :supporters
belongs_to :nonprofit belongs_to :nonprofit

View file

@ -1,9 +1,10 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class MiscellaneousNpInfo < ApplicationRecord class MiscellaneousNpInfo < ApplicationRecord
attr_accessible \ #TODO
:donate_again_url, # attr_accessible \
:change_amount_message # :donate_again_url,
# :change_amount_message
belongs_to :nonprofit belongs_to :nonprofit
end end

View file

@ -3,54 +3,55 @@ class Nonprofit < ApplicationRecord
Categories = ["Public Benefit", "Human Services", "Education", "Civic Duty", "Human Rights", "Animals", "Environment", "Health", "Arts, Culture, Humanities", "International", "Children", "Religion", "LGBTQ", "Women's Rights", "Disaster Relief", "Veterans"] Categories = ["Public Benefit", "Human Services", "Education", "Civic Duty", "Human Rights", "Animals", "Environment", "Health", "Arts, Culture, Humanities", "International", "Children", "Religion", "LGBTQ", "Women's Rights", "Disaster Relief", "Veterans"]
attr_accessible \ #TODO
:name, # str # attr_accessible \
:stripe_account_id, # str # :name, # str
:summary, # text: paragraph-sized organization summary # :stripe_account_id, # str
:tagline, # str # :summary, # text: paragraph-sized organization summary
:email, # str: public organization contact email # :tagline, # str
:phone, # str: public org contact phone # :email, # str: public organization contact email
:main_image, # str: url of featured image - first image in profile carousel # :phone, # str: public org contact phone
:second_image, # str: url of 2nd image in carousel # :main_image, # str: url of featured image - first image in profile carousel
:third_image, # str: url of 3rd image in carousel # :second_image, # str: url of 2nd image in carousel
:background_image, # str: url of large profile background # :third_image, # str: url of 3rd image in carousel
:remove_background_image, #bool carrierwave # :background_image, # str: url of large profile background
:logo, # str: small logo image url for searching # :remove_background_image, #bool carrierwave
:zip_code, # int # :logo, # str: small logo image url for searching
:website, # str: their own website url # :zip_code, # int
:categories, # text [str]: see the constant Categories # :website, # str: their own website url
:achievements, # text [str]: highlights about this org # :categories, # text [str]: see the constant Categories
:full_description, # text # :achievements, # text [str]: highlights about this org
:state_code, # str: two-letter state code (eg. CA) # :full_description, # text
:statement, # str: bank statement for donations towards the nonprofit # :state_code, # str: two-letter state code (eg. CA)
:city, # str # :statement, # str: bank statement for donations towards the nonprofit
:slug, # str # :city, # str
:city_slug, #str # :slug, # str
:state_code_slug, #str # :city_slug, #str
:ein, # str: employee identification number # :state_code_slug, #str
:published, # boolean; whether to display this profile # :ein, # str: employee identification number
:vetted, # bool: Whether a super admin (one of CommitChange's employees) have approved this org # :published, # boolean; whether to display this profile
:verification_status, # str (either 'pending', 'unverified', 'escalated', 'verified' -- whether the org has submitted the identity verification form and it has been approved) # :vetted, # bool: Whether a super admin (one of CommitChange's employees) have approved this org
:latitude, # float: geocoder gem # :verification_status, # str (either 'pending', 'unverified', 'escalated', 'verified' -- whether the org has submitted the identity verification form and it has been approved)
:longitude, # float: geocoder gem # :latitude, # float: geocoder gem
:timezone, # str # :longitude, # float: geocoder gem
:address, # text # :timezone, # str
:thank_you_note, # text # :address, # text
:referrer, # str # :thank_you_note, # text
:no_anon, # bool: whether to allow anonymous donations # :referrer, # str
:roles_attributes, # :no_anon, # bool: whether to allow anonymous donations
:brand_font, #string (lowercase key eg. 'helvetica') # :roles_attributes,
:brand_color, #string (hex color value) # :brand_font, #string (lowercase key eg. 'helvetica')
:hide_activity_feed, # bool # :brand_color, #string (hex color value)
:tracking_script, # :hide_activity_feed, # bool
:facebook, #string (url) # :tracking_script,
:twitter, #string (url) # :facebook, #string (url)
:youtube, #string (url) # :twitter, #string (url)
:instagram, #string (url) # :youtube, #string (url)
:blog, #string (url) # :instagram, #string (url)
:card_failure_message_top, # text # :blog, #string (url)
:card_failure_message_bottom, # text # :card_failure_message_top, # text
:autocomplete_supporter_address # boolean # :card_failure_message_bottom, # text
# :autocomplete_supporter_address # boolean
has_many :payouts has_many :payouts
has_many :charges has_many :charges

View file

@ -1,9 +1,10 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class NonprofitAccount < ApplicationRecord class NonprofitAccount < ApplicationRecord
attr_accessible \ #TODO
:stripe_account_id, #str # attr_accessible \
:nonprofit, :nonprofit_id #int # :stripe_account_id, #str
# :nonprofit, :nonprofit_id #int
belongs_to :nonprofit belongs_to :nonprofit

View file

@ -5,13 +5,14 @@
class Payment < ApplicationRecord class Payment < ApplicationRecord
attr_accessible \ #TODO
:towards, # attr_accessible \
:gross_amount, # :towards,
:refund_total, # :gross_amount,
:fee_total, # :refund_total,
:kind, # :fee_total,
:date # :kind,
# :date
belongs_to :supporter belongs_to :supporter
belongs_to :nonprofit belongs_to :nonprofit

View file

@ -13,11 +13,12 @@
class PaymentPayout < ApplicationRecord class PaymentPayout < ApplicationRecord
attr_accessible \ #TODO
:payment_id, :payment, # attr_accessible \
:charge_id, :charge, # deprecated # :payment_id, :payment,
:payout_id, :payout, # :charge_id, :charge, # deprecated
:total_fees # int (cents) # :payout_id, :payout,
# :total_fees # int (cents)
belongs_to :charge # deprecated belongs_to :charge # deprecated
belongs_to :payment belongs_to :payment

View file

@ -6,20 +6,21 @@
class Payout < ApplicationRecord class Payout < ApplicationRecord
attr_accessible \ #TODO
:scheduled, # bool (whether this was made automatically at the beginning of the month) # attr_accessible \
:count, # int (number of donations for this payout) # :scheduled, # bool (whether this was made automatically at the beginning of the month)
:ach_fee, # int (in cents, the total fee for the payout itself) # :count, # int (number of donations for this payout)
:gross_amount, # int (in cents, total amount before fees) # :ach_fee, # int (in cents, the total fee for the payout itself)
:fee_total, # int (in cents, total amount of fees) # :gross_amount, # int (in cents, total amount before fees)
:net_amount, # int (in cents, total amount after fees for this payout) # :fee_total, # int (in cents, total amount of fees)
:email, # str (cache of user email who issued this) # :net_amount, # int (in cents, total amount after fees for this payout)
:user_ip, # str (ip address of the user who made this payout) # :email, # str (cache of user email who issued this)
:status, # str ('pending', 'paid', 'canceled', or 'failed') # :user_ip, # str (ip address of the user who made this payout)
:failure_message, # str # :status, # str ('pending', 'paid', 'canceled', or 'failed')
:bank_name, # str: cache of the nonprofit's bank name # :failure_message, # str
:stripe_transfer_id, # str # :bank_name, # str: cache of the nonprofit's bank name
:nonprofit_id, :nonprofit # :stripe_transfer_id, # str
# :nonprofit_id, :nonprofit
belongs_to :nonprofit belongs_to :nonprofit
has_one :bank_account, through: :nonprofit has_one :bank_account, through: :nonprofit

View file

@ -1,23 +1,24 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class Profile < ApplicationRecord class Profile < ApplicationRecord
attr_accessible \ #TODO
:registered, # bool # attr_accessible \
:mini_bio, # :registered, # bool
:first_name, # str # :mini_bio,
:last_name, # str # :first_name, # str
:name, # :last_name, # str
:phone, # str # :name,
:address, # str # :phone, # str
:email, # str # :address, # str
:city, # str # :email, # str
:state_code, # str (eg. CA) # :city, # str
:zip_code, # str # :state_code, # str (eg. CA)
:privacy_settings, # text [str]: XXX deprecated # :zip_code, # str
:picture, # str: either their social network pic or a stored pic on S3 # :privacy_settings, # text [str]: XXX deprecated
:anonymous, # bool: negates all privacy_settings # :picture, # str: either their social network pic or a stored pic on S3
:city_state, # :anonymous, # bool: negates all privacy_settings
:user_id # :city_state,
# :user_id
validates :email, format: {with: Email::Regex}, allow_blank: true validates :email, format: {with: Email::Regex}, allow_blank: true

View file

@ -1,21 +1,22 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class RecurringDonation < ApplicationRecord class RecurringDonation < ApplicationRecord
attr_accessible \ #TODO:
:amount, # int (cents) # attr_accessible \
:active, # bool (whether this recurring donation should still be paid) # :amount, # int (cents)
:paydate, # int (fixed date of the month for monthly recurring donations) # :active, # bool (whether this recurring donation should still be paid)
:interval, # int (interval of time, ie the '3' in '3 months') # :paydate, # int (fixed date of the month for monthly recurring donations)
:time_unit, # str ('month', 'day', 'week', or 'year') # :interval, # int (interval of time, ie the '3' in '3 months')
:start_date, # date (when to start this recurring donation) # :time_unit, # str ('month', 'day', 'week', or 'year')
:end_date, # date (when to deactivate this recurring donation) # :start_date, # date (when to start this recurring donation)
:n_failures, # int (how many times the charge has failed) # :end_date, # date (when to deactivate this recurring donation)
:edit_token, # str / uuid to validate the editing page, linked from their email client # :n_failures, # int (how many times the charge has failed)
:cancelled_by, # str email of user/supporter who made the cancellation # :edit_token, # str / uuid to validate the editing page, linked from their email client
:cancelled_at, # datetime of user/supporter who made the cancellation # :cancelled_by, # str email of user/supporter who made the cancellation
:donation_id, :donation, # :cancelled_at, # datetime of user/supporter who made the cancellation
:nonprofit_id, :nonprofit, # :donation_id, :donation,
:supporter_id #used because things are messed up in the datamodel # :nonprofit_id, :nonprofit,
# :supporter_id #used because things are messed up in the datamodel
scope :active, -> {where(active: true)} scope :active, -> {where(active: true)}
scope :inactive, -> {where(active: [false,nil])} scope :inactive, -> {where(active: [false,nil])}

View file

@ -3,16 +3,17 @@ class Refund < ApplicationRecord
Reasons = [:duplicate, :fraudulent, :requested_by_customer] Reasons = [:duplicate, :fraudulent, :requested_by_customer]
attr_accessible \ # TODO:
:amount, # int # attr_accessible \
:comment, # text # :amount, # int
:reason, # str ('duplicate', 'fraudulent', or 'requested_by_customer') # :comment, # text
:stripe_refund_id, # :reason, # str ('duplicate', 'fraudulent', or 'requested_by_customer')
:disbursed, # boolean (whether this refund has been counted in a payout) # :stripe_refund_id,
:failure_message, # str (accessor for storing the Stripe error message) # :disbursed, # boolean (whether this refund has been counted in a payout)
:user_id, :user, # user who made this refund # :failure_message, # str (accessor for storing the Stripe error message)
:payment_id, :payment, # negative payment that records this refund # :user_id, :user, # user who made this refund
:charge_id, :charge # :payment_id, :payment, # negative payment that records this refund
# :charge_id, :charge
attr_accessor :failure_message attr_accessor :failure_message

View file

@ -10,10 +10,11 @@ class Role < ApplicationRecord
:event_editor # // :event_editor # //
] ]
attr_accessible \ # TODO:
:name, # attr_accessible \
:user_id, :user, # :name,
:host, :host_id, :host_type # nil, "Nonprofit", "Campaign", "Event" # :user_id, :user,
# :host, :host_id, :host_type # nil, "Nonprofit", "Campaign", "Event"
belongs_to :user belongs_to :user
belongs_to :host, polymorphic: true belongs_to :host, polymorphic: true

View file

@ -1,33 +1,34 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class Supporter < ApplicationRecord class Supporter < ApplicationRecord
attr_accessible \ #TODO
:search_vectors, # attr_accessible \
:profile_id, :profile, # :search_vectors,
:nonprofit_id, :nonprofit, # :profile_id, :profile,
:full_contact_info, :full_contact_info_id, # :nonprofit_id, :nonprofit,
:import_id, :import, # :full_contact_info, :full_contact_info_id,
:name, # :import_id, :import,
:first_name, # :name,
:last_name, # :first_name,
:email, # :last_name,
:address, # :email,
:city, # :address,
:state_code, # :city,
:country, # :state_code,
:phone, # :country,
:organization, # :phone,
:latitude, # :organization,
:locale, # :latitude,
:longitude, # :locale,
:zip_code, # :longitude,
:total_raised, # :zip_code,
:notes, # :total_raised,
:fields, # :notes,
:anonymous, # :fields,
:deleted, # bool (flag for soft delete) # :anonymous,
:email_unsubscribe_uuid, #string # :deleted, # bool (flag for soft delete)
:is_unsubscribed_from_emails #bool # :email_unsubscribe_uuid, #string
# :is_unsubscribed_from_emails #bool
belongs_to :profile belongs_to :profile
belongs_to :nonprofit belongs_to :nonprofit

View file

@ -1,14 +1,15 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class SupporterEmail < ApplicationRecord class SupporterEmail < ApplicationRecord
attr_accessible \ # TODO
:to, # attr_accessible \
:from, # :to,
:subject, # :from,
:body, # :subject,
:recipient_count, # :body,
:supporter_id, :supporter, # :recipient_count,
:nonprofit_id, # :supporter_id, :supporter,
:gmail_thread_id # :nonprofit_id,
# :gmail_thread_id
belongs_to :supporter belongs_to :supporter
validates_presence_of :nonprofit_id validates_presence_of :nonprofit_id

View file

@ -1,9 +1,10 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class SupporterNote < ApplicationRecord class SupporterNote < ApplicationRecord
attr_accessible \ #TODO
:content, # attr_accessible \
:supporter_id, :supporter # :content,
# :supporter_id, :supporter
belongs_to :supporter belongs_to :supporter
has_many :activities, as: :attachment, dependent: :destroy has_many :activities, as: :attachment, dependent: :destroy

View file

@ -1,9 +1,10 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class TagJoin < ApplicationRecord class TagJoin < ApplicationRecord
attr_accessible \ #TODO
:supporter, :supporter_id, # attr_accessible \
:tag_master, :tag_master_id # :supporter, :supporter_id,
# :tag_master, :tag_master_id
validates :tag_master, presence: true validates :tag_master, presence: true

View file

@ -1,11 +1,12 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class TagMaster < ApplicationRecord class TagMaster < ApplicationRecord
attr_accessible \ #TODO:
:nonprofit, :nonprofit_id, # attr_accessible \
:name, # :nonprofit, :nonprofit_id,
:deleted, # :name,
:created_at # :deleted,
# :created_at
validates :name, presence: true validates :name, presence: true
validate :no_dupes, on: :create validate :no_dupes, on: :create

View file

@ -1,17 +1,18 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class TicketLevel < ApplicationRecord class TicketLevel < ApplicationRecord
attr_accessible \ #TODO
:amount, #integer # attr_accessible \
:amount_dollars, #accessor, string # :amount, #integer
:name, #string # :amount_dollars, #accessor, string
:description, #text # :name, #string
:quantity, #integer # :description, #text
:deleted, #bool for soft delete # :quantity, #integer
:event_id, # :deleted, #bool for soft delete
:admin_only, #bool, only admins can create tickets for this level # :event_id,
:limit, #int: for limiting the number of tickets to be sold # :admin_only, #bool, only admins can create tickets for this level
:order #int: order in which to be displayed # :limit, #int: for limiting the number of tickets to be sold
# :order #int: order in which to be displayed
attr_accessor :amount_dollars attr_accessor :amount_dollars

View file

@ -1,29 +1,30 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class User < ApplicationRecord class User < ApplicationRecord
attr_accessible \ #TODO:
:email, # str: balidated with Devise # attr_accessible \
:password, # str: hashed with bcrypt # :email, # str: balidated with Devise
:phone, # str # :password, # str: hashed with bcrypt
:location, # :phone, # str
:city, # :location,
:state_code, # :city,
:password_confirmation, # accessor: used on registration # :state_code,
:remember_me, # bool: don't sign user out for a while # :password_confirmation, # accessor: used on registration
:provider, # str: OAuth provider # :remember_me, # bool: don't sign user out for a while
:uid, # str: OAuth user ID # :provider, # str: OAuth provider
:pending_password, # bool: User registered with oauth and did not set a password # :uid, # str: OAuth user ID
:name, # str: created with oauth # :pending_password, # bool: User registered with oauth and did not set a password
:auto_generated, # bool: flag whether a password was auto-generated for this account # :name, # str: created with oauth
:referer, # str: ID of the user who referred this account # :auto_generated, # bool: flag whether a password was auto-generated for this account
:latitude, # :referer, # str: ID of the user who referred this account
:longitude, # :latitude,
:reset_password_token, # :longitude,
:reset_password_sent_at, # :reset_password_token,
:picture, # str: url for fb or twitter pic # :reset_password_sent_at,
:current_password, # accessor: for updating pass # :picture, # str: url for fb or twitter pic
:profile_attributes, # :current_password, # accessor: for updating pass
:phone # :profile_attributes,
# :phone
geocoded_by :location geocoded_by :location