Models now inherit from ApplicationRecord

This commit is contained in:
Eric Schultz 2019-02-01 13:40:24 -06:00 committed by Luis Castro
parent 4071455dee
commit d3535c0b80
No known key found for this signature in database
GPG key ID: 0A8F33D4C4E27639
52 changed files with 56 additions and 51 deletions

View file

@ -1,5 +1,5 @@
# 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 Activity < ActiveRecord::Base class Activity < ApplicationRecord
end end

View file

@ -0,0 +1,5 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end

View file

@ -1,5 +1,5 @@
# 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 < ActiveRecord::Base class BankAccount < ApplicationRecord
attr_accessible \ attr_accessible \
:name, # str (readable bank name identifier, eg. "Wells Fargo *1234") :name, # str (readable bank name identifier, eg. "Wells Fargo *1234")

View file

@ -1,5 +1,5 @@
# 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 BillingPlan < ActiveRecord::Base 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

View file

@ -1,5 +1,5 @@
# 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 < ActiveRecord::Base class BillingSubscription < ApplicationRecord
attr_accessible \ attr_accessible \
:nonprofit_id, :nonprofit, :nonprofit_id, :nonprofit,

View file

@ -1,5 +1,5 @@
# 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 < ActiveRecord::Base class Campaign < ApplicationRecord
attr_accessible \ attr_accessible \
:name, :name,

View file

@ -1,5 +1,5 @@
# 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 < ActiveRecord::Base class CampaignGift < ApplicationRecord
attr_accessible \ attr_accessible \
:donation_id, :donation_id,

View file

@ -1,5 +1,5 @@
# 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 < ActiveRecord::Base class CampaignGiftOption < ApplicationRecord
attr_accessible \ attr_accessible \
:amount_one_time, #int (cents) :amount_one_time, #int (cents)

View file

@ -1,5 +1,5 @@
# 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 < ActiveRecord::Base class Card < ApplicationRecord
attr_accessible \ attr_accessible \
:cardholders_name, # str (name associated with this card) :cardholders_name, # str (name associated with this card)

View file

@ -1,7 +1,7 @@
# 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
# A Charge represents a potential debit to a nonprofit's account on a credit card donation action. # A Charge represents a potential debit to a nonprofit's account on a credit card donation action.
class Charge < ActiveRecord::Base class Charge < ApplicationRecord
attr_accessible \ attr_accessible \
:amount, :amount,

View file

@ -1,5 +1,5 @@
# 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 < ActiveRecord::Base class Comment < ApplicationRecord
attr_accessible \ attr_accessible \
:host_id, :host_type, #parent: Event, Campaign, nil :host_id, :host_type, #parent: Event, Campaign, nil

View file

@ -1,5 +1,5 @@
# 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 Coupon < ActiveRecord::Base class Coupon < ApplicationRecord
attr_accessible \ attr_accessible \
:name, :name,
:victim_np_id, :victim_np_id,

View file

@ -1,5 +1,5 @@
# 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 < ActiveRecord::Base class CustomFieldJoin < ApplicationRecord
attr_accessible \ attr_accessible \
:supporter, :supporter_id, :supporter, :supporter_id,

View file

@ -1,5 +1,5 @@
# 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 CustomFieldMaster < ActiveRecord::Base class CustomFieldMaster < ApplicationRecord
attr_accessible \ attr_accessible \
:nonprofit, :nonprofit_id, :nonprofit, :nonprofit_id,

View file

@ -1,5 +1,5 @@
# 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 DirectDebitDetail < ActiveRecord::Base class DirectDebitDetail < ApplicationRecord
attr_accessible :iban, :account_holder_name, :bic, :supporter_id, :holder attr_accessible :iban, :account_holder_name, :bic, :supporter_id, :holder
has_many :donations has_many :donations

View file

@ -1,5 +1,5 @@
# 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 Dispute < ActiveRecord::Base 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]

View file

@ -1,5 +1,5 @@
# 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 < ActiveRecord::Base class Donation < ApplicationRecord
attr_accessible \ attr_accessible \
:date, # datetime (when this donation was made) :date, # datetime (when this donation was made)

View file

@ -1,5 +1,5 @@
# 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 < ActiveRecord::Base class EmailDraft < ApplicationRecord
attr_accessible \ attr_accessible \
:nonprofit, :nonprofit_id, :nonprofit, :nonprofit_id,

View file

@ -1,5 +1,5 @@
# 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 EmailList < ActiveRecord::Base class EmailList < ApplicationRecord
attr_accessible :list_name, :mailchimp_list_id, :nonprofit, :tag_master attr_accessible :list_name, :mailchimp_list_id, :nonprofit, :tag_master
belongs_to :nonprofit belongs_to :nonprofit
belongs_to :tag_master belongs_to :tag_master

View file

@ -1,5 +1,5 @@
# 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 < ActiveRecord::Base class EmailSetting < ApplicationRecord
attr_accessible \ attr_accessible \
:user_id, :user, :user_id, :user,

View file

@ -1,5 +1,5 @@
# 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 < ActiveRecord::Base class Event < ApplicationRecord
attr_accessible \ attr_accessible \
:deleted, #bool for soft-delete :deleted, #bool for soft-delete

View file

@ -1,5 +1,5 @@
# 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 < ActiveRecord::Base class EventDiscount < ApplicationRecord
attr_accessible \ attr_accessible \
:code, :code,
:event_id, :event_id,

View file

@ -1,5 +1,5 @@
# 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 Export < ActiveRecord::Base class Export < ApplicationRecord
STATUS = %w[queued started completed failed].freeze STATUS = %w[queued started completed failed].freeze
attr_accessible :exception, :nonprofit, :status, :user, :export_type, :parameters, :ended, :url, :user_id, :nonprofit_id attr_accessible :exception, :nonprofit, :status, :user, :export_type, :parameters, :ended, :url, :user_id, :nonprofit_id

View file

@ -1,5 +1,5 @@
# 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 < ActiveRecord::Base class FullContactInfo < ApplicationRecord
attr_accessible \ attr_accessible \
:email, :email,
:full_name, :full_name,

View file

@ -1,5 +1,5 @@
# 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 < ActiveRecord::Base class FullContactOrg < ApplicationRecord
attr_accessible \ attr_accessible \
:name, :name,

View file

@ -1,5 +1,5 @@
# 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 < ActiveRecord::Base class FullContactPhoto < ApplicationRecord
attr_accessible \ attr_accessible \
:full_contact_info, :full_contact_info,
:full_contact_info_id, :full_contact_info_id,

View file

@ -1,5 +1,5 @@
# 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 < ActiveRecord::Base class FullContactSocialProfile < ApplicationRecord
attr_accessible \ attr_accessible \
:full_contact_info, :full_contact_info,
:full_contact_info_id, :full_contact_info_id,

View file

@ -1,5 +1,5 @@
# 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 < ActiveRecord::Base class FullContactTopic < ApplicationRecord
attr_accessible \ attr_accessible \
:provider, :provider,

View file

@ -1,5 +1,5 @@
# 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 ImageAttachment < ActiveRecord::Base class ImageAttachment < ApplicationRecord
attr_accessible :parent_id, :file attr_accessible :parent_id, :file
mount_uploader :file, ImageAttachmentUploader mount_uploader :file, ImageAttachmentUploader

View file

@ -1,5 +1,5 @@
# 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 < ActiveRecord::Base class Import < ApplicationRecord
attr_accessible \ attr_accessible \
:user_id, :user, :user_id, :user,

View file

@ -1,5 +1,5 @@
# 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 < ActiveRecord::Base class MiscellaneousNpInfo < ApplicationRecord
attr_accessible \ attr_accessible \
:donate_again_url, :donate_again_url,

View file

@ -1,5 +1,5 @@
# 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 Nonprofit < ActiveRecord::Base 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"]

View file

@ -1,5 +1,5 @@
# 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 < ActiveRecord::Base class NonprofitAccount < ApplicationRecord
attr_accessible \ attr_accessible \
:stripe_account_id, #str :stripe_account_id, #str

View file

@ -1,5 +1,5 @@
# 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 OffsitePayment < ActiveRecord::Base class OffsitePayment < ApplicationRecord
attr_accessible :gross_amount, :kind, :date, :check_number attr_accessible :gross_amount, :kind, :date, :check_number
belongs_to :payment, dependent: :destroy belongs_to :payment, dependent: :destroy

View file

@ -3,7 +3,7 @@
# If connected to a charge, this represents money potentially debited to the nonprofit's account # If connected to a charge, this represents money potentially debited to the nonprofit's account
# If connected to an offsite_payment, this is money the nonprofit is recording for convenience. # If connected to an offsite_payment, this is money the nonprofit is recording for convenience.
class Payment < ActiveRecord::Base class Payment < ApplicationRecord
attr_accessible \ attr_accessible \
:towards, :towards,

View file

@ -1,5 +1,5 @@
# 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 PaymentImport < ActiveRecord::Base class PaymentImport < ApplicationRecord
attr_accessible :nonprofit, :user attr_accessible :nonprofit, :user
has_and_belongs_to_many :donations has_and_belongs_to_many :donations
belongs_to :nonprofit belongs_to :nonprofit

View file

@ -11,7 +11,7 @@
# It's also nice to keep a historical records of fees for individual donations # It's also nice to keep a historical records of fees for individual donations
# since our fees will continue to change as our transaction volume increases # since our fees will continue to change as our transaction volume increases
class PaymentPayout < ActiveRecord::Base class PaymentPayout < ApplicationRecord
attr_accessible \ attr_accessible \
:payment_id, :payment, :payment_id, :payment,

View file

@ -4,7 +4,7 @@
# #
# These are tied to Stripe transfers # These are tied to Stripe transfers
class Payout < ActiveRecord::Base class Payout < ApplicationRecord
attr_accessible \ attr_accessible \
:scheduled, # bool (whether this was made automatically at the beginning of the month) :scheduled, # bool (whether this was made automatically at the beginning of the month)

View file

@ -1,5 +1,5 @@
# 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 < ActiveRecord::Base class Profile < ApplicationRecord
attr_accessible \ attr_accessible \
:registered, # bool :registered, # bool

View file

@ -1,5 +1,5 @@
# 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 < ActiveRecord::Base class RecurringDonation < ApplicationRecord
attr_accessible \ attr_accessible \
:amount, # int (cents) :amount, # int (cents)

View file

@ -1,5 +1,5 @@
# 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 Refund < ActiveRecord::Base class Refund < ApplicationRecord
Reasons = [:duplicate, :fraudulent, :requested_by_customer] Reasons = [:duplicate, :fraudulent, :requested_by_customer]

View file

@ -1,5 +1,5 @@
# 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 Role < ActiveRecord::Base class Role < ApplicationRecord
Names = [ Names = [
:super_admin, # global access :super_admin, # global access

View file

@ -1,5 +1,5 @@
# 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 SourceToken < ActiveRecord::Base class SourceToken < ApplicationRecord
self.primary_key = :token self.primary_key = :token
attr_accessible :expiration, :token, :max_uses, :total_uses attr_accessible :expiration, :token, :max_uses, :total_uses
belongs_to :tokenizable, :polymorphic => true belongs_to :tokenizable, :polymorphic => true

View file

@ -1,5 +1,5 @@
# 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 < ActiveRecord::Base class Supporter < ApplicationRecord
attr_accessible \ attr_accessible \
:search_vectors, :search_vectors,

View file

@ -1,5 +1,5 @@
# 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 < ActiveRecord::Base class SupporterEmail < ApplicationRecord
attr_accessible \ attr_accessible \
:to, :to,
:from, :from,

View file

@ -1,5 +1,5 @@
# 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 < ActiveRecord::Base class SupporterNote < ApplicationRecord
attr_accessible \ attr_accessible \
:content, :content,

View file

@ -1,5 +1,5 @@
# 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 < ActiveRecord::Base class TagJoin < ApplicationRecord
attr_accessible \ attr_accessible \
:supporter, :supporter_id, :supporter, :supporter_id,

View file

@ -1,5 +1,5 @@
# 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 < ActiveRecord::Base class TagMaster < ApplicationRecord
attr_accessible \ attr_accessible \
:nonprofit, :nonprofit_id, :nonprofit, :nonprofit_id,

View file

@ -1,5 +1,5 @@
# 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 Ticket < ActiveRecord::Base class Ticket < ApplicationRecord
attr_accessible :note, :event_discount, :event_discount_id attr_accessible :note, :event_discount, :event_discount_id

View file

@ -1,5 +1,5 @@
# 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 < ActiveRecord::Base class TicketLevel < ApplicationRecord
attr_accessible \ attr_accessible \
:amount, #integer :amount, #integer

View file

@ -1,5 +1,5 @@
# 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 Tracking < ActiveRecord::Base class Tracking < ApplicationRecord
attr_accessible :utm_campaign, :utm_content, :utm_medium, :utm_source attr_accessible :utm_campaign, :utm_content, :utm_medium, :utm_source
belongs_to :donation belongs_to :donation

View file

@ -1,5 +1,5 @@
# 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 < ActiveRecord::Base class User < ApplicationRecord
attr_accessible \ attr_accessible \
:email, # str: balidated with Devise :email, # str: balidated with Devise