style(models): normalize comments style
This commit is contained in:
parent
fa77979712
commit
c64adad9ad
25 changed files with 171 additions and 184 deletions
|
@ -2,7 +2,11 @@
|
|||
|
||||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
class DirectDebitDetail < ApplicationRecord
|
||||
# attr_accessible :iban, :account_holder_name, :bic, :supporter_id, :holder
|
||||
# :iban,
|
||||
# :account_holder_name,
|
||||
# :bic,
|
||||
# :supporter_id,
|
||||
# :holder
|
||||
|
||||
has_many :donations
|
||||
has_many :charges
|
||||
|
|
|
@ -5,13 +5,13 @@ class Dispute < ApplicationRecord
|
|||
Reasons = %i[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].freeze
|
||||
|
||||
Statuses = %i[needs_response under_review won lost lost_and_paid].freeze
|
||||
# TODO
|
||||
# attr_accessible \
|
||||
# :gross_amount, # int
|
||||
# :charge_id, :charge,
|
||||
# :payment_id, :payment,
|
||||
# :status,
|
||||
# :reason
|
||||
# :gross_amount, # int
|
||||
# :charge_id,
|
||||
# :charge,
|
||||
# :payment_id,
|
||||
# :payment,
|
||||
# :status,
|
||||
# :reason
|
||||
|
||||
belongs_to :charge
|
||||
belongs_to :payment
|
||||
|
|
|
@ -2,13 +2,11 @@
|
|||
|
||||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
class EmailDraft < ApplicationRecord
|
||||
# TODO
|
||||
# attr_accessible \
|
||||
# :nonprofit, :nonprofit_id,
|
||||
# :name,
|
||||
# :deleted,
|
||||
# :value,
|
||||
# :created_at
|
||||
# :nonprofit, :nonprofit_id,
|
||||
# :name,
|
||||
# :deleted,
|
||||
# :value,
|
||||
# :created_at
|
||||
|
||||
belongs_to :nonprofit
|
||||
|
||||
|
|
|
@ -2,8 +2,18 @@
|
|||
|
||||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
class Export < ApplicationRecord
|
||||
# :exception,
|
||||
# :nonprofit,
|
||||
# :status,
|
||||
# :user,
|
||||
# :export_type,
|
||||
# :parameters,
|
||||
# :ended,
|
||||
# :url,
|
||||
# :user_id,
|
||||
# :nonprofit_id
|
||||
|
||||
STATUS = %w[queued started completed failed].freeze
|
||||
# attr_accessible :exception, :nonprofit, :status, :user, :export_type, :parameters, :ended, :url, :user_id, :nonprofit_id
|
||||
|
||||
belongs_to :nonprofit
|
||||
belongs_to :user
|
||||
|
|
|
@ -2,18 +2,16 @@
|
|||
|
||||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
class FullContactInfo < ApplicationRecord
|
||||
# TODO
|
||||
# attr_accessible \
|
||||
# :email,
|
||||
# :full_name,
|
||||
# :gender,
|
||||
# :city,
|
||||
# :county,
|
||||
# :state_code,
|
||||
# :country,
|
||||
# :continent,
|
||||
# :age,
|
||||
# :age_range,
|
||||
# :email,
|
||||
# :full_name,
|
||||
# :gender,
|
||||
# :city,
|
||||
# :county,
|
||||
# :state_code,
|
||||
# :country,
|
||||
# :continent,
|
||||
# :age,
|
||||
# :age_range,
|
||||
# :location_general,
|
||||
# :supporter_id, :supporter,
|
||||
# :websites
|
||||
|
|
|
@ -2,16 +2,14 @@
|
|||
|
||||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
class FullContactOrg < ApplicationRecord
|
||||
# TODO
|
||||
# attr_accessible \
|
||||
# :name,
|
||||
# :is_primary,
|
||||
# :name,
|
||||
# :start_date,
|
||||
# :end_date,
|
||||
# :title,
|
||||
# :current,
|
||||
# :full_contact_info_id, :full_contact_info
|
||||
# :name,
|
||||
# :is_primary,
|
||||
# :name,
|
||||
# :start_date,
|
||||
# :end_date,
|
||||
# :title,
|
||||
# :current,
|
||||
# :full_contact_info_id, :full_contact_info
|
||||
|
||||
belongs_to :full_contact_info
|
||||
end
|
||||
|
|
|
@ -2,13 +2,11 @@
|
|||
|
||||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
class FullContactPhoto < ApplicationRecord
|
||||
# TODO
|
||||
# attr_accessible \
|
||||
# :full_contact_info,
|
||||
# :full_contact_info_id,
|
||||
# :type_id, # i.e. twitter, linkedin, facebook
|
||||
# :is_primary, #bool
|
||||
# :url #string
|
||||
# :full_contact_info,
|
||||
# :full_contact_info_id,
|
||||
# :type_id, # i.e. twitter, linkedin, facebook
|
||||
# :is_primary, #bool
|
||||
# :url #string
|
||||
|
||||
belongs_to :full_contact_info
|
||||
|
||||
|
|
|
@ -2,15 +2,13 @@
|
|||
|
||||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
class FullContactSocialProfile < ApplicationRecord
|
||||
# TODO
|
||||
# attr_accessible \
|
||||
# :full_contact_info,
|
||||
# :full_contact_info_id,
|
||||
# :type_id, # i.e. twitter, linkedin, facebook
|
||||
# :username, #string
|
||||
# :uid, # string
|
||||
# :bio, #string
|
||||
# :url #string
|
||||
# :full_contact_info,
|
||||
# :full_contact_info_id,
|
||||
# :type_id, # i.e. twitter, linkedin, facebook
|
||||
# :username, #string
|
||||
# :uid, # string
|
||||
# :bio, #string
|
||||
# :url #string
|
||||
|
||||
belongs_to :full_contact_info
|
||||
|
||||
|
|
|
@ -2,11 +2,9 @@
|
|||
|
||||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
class FullContactTopic < ApplicationRecord
|
||||
# TODO
|
||||
# attr_accessible \
|
||||
# :provider,
|
||||
# :value,
|
||||
# :full_contact_info_id, :full_contact_info
|
||||
# :provider,
|
||||
# :value,
|
||||
# :full_contact_info_id, :full_contact_info
|
||||
|
||||
belongs_to :full_contact_info
|
||||
end
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
|
||||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
class ImageAttachment < ApplicationRecord
|
||||
attr_accessible :parent_id, :file
|
||||
# :parent_id,
|
||||
# :file
|
||||
mount_uploader :file, ImageAttachmentUploader
|
||||
|
||||
# not sure if poly parent is used on this model, as all values are nil in db
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
class MiscellaneousNpInfo < ApplicationRecord
|
||||
# TODO
|
||||
# attr_accessible \
|
||||
# :donate_again_url,
|
||||
# :change_amount_message
|
||||
|
||||
|
|
|
@ -2,10 +2,8 @@
|
|||
|
||||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
class NonprofitAccount < ApplicationRecord
|
||||
# TODO
|
||||
# attr_accessible \
|
||||
# :stripe_account_id, #str
|
||||
# :nonprofit, :nonprofit_id #int
|
||||
# :stripe_account_id, #str
|
||||
# :nonprofit, :nonprofit_id #int
|
||||
|
||||
belongs_to :nonprofit
|
||||
|
||||
|
|
|
@ -2,7 +2,10 @@
|
|||
|
||||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
class OffsitePayment < ApplicationRecord
|
||||
# attr_accessible :gross_amount, :kind, :date, :check_number
|
||||
# :gross_amount,
|
||||
# :kind,
|
||||
# :date,
|
||||
# :check_number
|
||||
belongs_to :payment, dependent: :destroy
|
||||
belongs_to :donation
|
||||
belongs_to :nonprofit
|
||||
|
|
|
@ -6,14 +6,12 @@
|
|||
# If connected to an offsite_payment, this is money the nonprofit is recording for convenience.
|
||||
|
||||
class Payment < ApplicationRecord
|
||||
# TODO
|
||||
# attr_accessible \
|
||||
# :towards,
|
||||
# :gross_amount,
|
||||
# :refund_total,
|
||||
# :fee_total,
|
||||
# :kind,
|
||||
# :date
|
||||
# :towards,
|
||||
# :gross_amount,
|
||||
# :refund_total,
|
||||
# :fee_total,
|
||||
# :kind,
|
||||
# :date
|
||||
|
||||
belongs_to :supporter
|
||||
belongs_to :nonprofit
|
||||
|
|
|
@ -14,12 +14,10 @@
|
|||
# since our fees will continue to change as our transaction volume increases
|
||||
|
||||
class PaymentPayout < ApplicationRecord
|
||||
# TODO
|
||||
# attr_accessible \
|
||||
# :payment_id, :payment,
|
||||
# :charge_id, :charge, # deprecated
|
||||
# :payout_id, :payout,
|
||||
# :total_fees # int (cents)
|
||||
# :payment_id, :payment,
|
||||
# :charge_id, :charge, # deprecated
|
||||
# :payout_id, :payout,
|
||||
# :total_fees # int (cents)
|
||||
|
||||
belongs_to :charge # deprecated
|
||||
belongs_to :payment
|
||||
|
|
|
@ -7,21 +7,19 @@
|
|||
# These are tied to Stripe transfers
|
||||
|
||||
class Payout < ApplicationRecord
|
||||
# TODO
|
||||
# attr_accessible \
|
||||
# :scheduled, # bool (whether this was made automatically at the beginning of the month)
|
||||
# :count, # int (number of donations for this payout)
|
||||
# :ach_fee, # int (in cents, the total fee for the payout itself)
|
||||
# :gross_amount, # int (in cents, total amount before fees)
|
||||
# :fee_total, # int (in cents, total amount of fees)
|
||||
# :net_amount, # int (in cents, total amount after fees for this payout)
|
||||
# :email, # str (cache of user email who issued this)
|
||||
# :user_ip, # str (ip address of the user who made this payout)
|
||||
# :status, # str ('pending', 'paid', 'canceled', or 'failed')
|
||||
# :failure_message, # str
|
||||
# :bank_name, # str: cache of the nonprofit's bank name
|
||||
# :stripe_transfer_id, # str
|
||||
# :nonprofit_id, :nonprofit
|
||||
# :scheduled, # bool (whether this was made automatically at the beginning of the month)
|
||||
# :count, # int (number of donations for this payout)
|
||||
# :ach_fee, # int (in cents, the total fee for the payout itself)
|
||||
# :gross_amount, # int (in cents, total amount before fees)
|
||||
# :fee_total, # int (in cents, total amount of fees)
|
||||
# :net_amount, # int (in cents, total amount after fees for this payout)
|
||||
# :email, # str (cache of user email who issued this)
|
||||
# :user_ip, # str (ip address of the user who made this payout)
|
||||
# :status, # str ('pending', 'paid', 'canceled', or 'failed')
|
||||
# :failure_message, # str
|
||||
# :bank_name, # str: cache of the nonprofit's bank name
|
||||
# :stripe_transfer_id, # str
|
||||
# :nonprofit_id, :nonprofit
|
||||
|
||||
belongs_to :nonprofit
|
||||
has_one :bank_account, through: :nonprofit
|
||||
|
|
|
@ -3,18 +3,15 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
class Refund < ApplicationRecord
|
||||
Reasons = %i[duplicate fraudulent requested_by_customer].freeze
|
||||
|
||||
# TODO:
|
||||
# attr_accessible \
|
||||
# :amount, # int
|
||||
# :comment, # text
|
||||
# :reason, # str ('duplicate', 'fraudulent', or 'requested_by_customer')
|
||||
# :stripe_refund_id,
|
||||
# :disbursed, # boolean (whether this refund has been counted in a payout)
|
||||
# :failure_message, # str (accessor for storing the Stripe error message)
|
||||
# :user_id, :user, # user who made this refund
|
||||
# :payment_id, :payment, # negative payment that records this refund
|
||||
# :charge_id, :charge
|
||||
# :amount, # int
|
||||
# :comment, # text
|
||||
# :reason, # str ('duplicate', 'fraudulent', or 'requested_by_customer')
|
||||
# :stripe_refund_id,
|
||||
# :disbursed, # boolean (whether this refund has been counted in a payout)
|
||||
# :failure_message, # str (accessor for storing the Stripe error message)
|
||||
# :user_id, :user, # user who made this refund
|
||||
# :payment_id, :payment, # negative payment that records this refund
|
||||
# :charge_id, :charge
|
||||
|
||||
attr_accessor :failure_message
|
||||
|
||||
|
|
|
@ -3,7 +3,10 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
class SourceToken < ApplicationRecord
|
||||
self.primary_key = :token
|
||||
# attr_accessible :expiration, :token, :max_uses, :total_uses
|
||||
# :expiration,
|
||||
# :token,
|
||||
# :max_uses,
|
||||
# :total_uses
|
||||
belongs_to :tokenizable, polymorphic: true
|
||||
belongs_to :event
|
||||
end
|
||||
|
|
|
@ -2,34 +2,32 @@
|
|||
|
||||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
class Supporter < ApplicationRecord
|
||||
# TODO
|
||||
# attr_accessible \
|
||||
# :search_vectors,
|
||||
# :profile_id, :profile,
|
||||
# :nonprofit_id, :nonprofit,
|
||||
# :full_contact_info, :full_contact_info_id,
|
||||
# :import_id, :import,
|
||||
# :name,
|
||||
# :first_name,
|
||||
# :last_name,
|
||||
# :email,
|
||||
# :address,
|
||||
# :city,
|
||||
# :state_code,
|
||||
# :country,
|
||||
# :phone,
|
||||
# :organization,
|
||||
# :latitude,
|
||||
# :locale,
|
||||
# :longitude,
|
||||
# :zip_code,
|
||||
# :total_raised,
|
||||
# :notes,
|
||||
# :fields,
|
||||
# :anonymous,
|
||||
# :deleted, # bool (flag for soft delete)
|
||||
# :email_unsubscribe_uuid, #string
|
||||
# :is_unsubscribed_from_emails #bool
|
||||
# :search_vectors,
|
||||
# :profile_id, :profile,
|
||||
# :nonprofit_id, :nonprofit,
|
||||
# :full_contact_info, :full_contact_info_id,
|
||||
# :import_id, :import,
|
||||
# :name,
|
||||
# :first_name,
|
||||
# :last_name,
|
||||
# :email,
|
||||
# :address,
|
||||
# :city,
|
||||
# :state_code,
|
||||
# :country,
|
||||
# :phone,
|
||||
# :organization,
|
||||
# :latitude,
|
||||
# :locale,
|
||||
# :longitude,
|
||||
# :zip_code,
|
||||
# :total_raised,
|
||||
# :notes,
|
||||
# :fields,
|
||||
# :anonymous,
|
||||
# :deleted, # bool (flag for soft delete)
|
||||
# :email_unsubscribe_uuid, #string
|
||||
# :is_unsubscribed_from_emails #bool
|
||||
|
||||
belongs_to :profile
|
||||
belongs_to :nonprofit
|
||||
|
|
|
@ -2,16 +2,14 @@
|
|||
|
||||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
class SupporterEmail < ApplicationRecord
|
||||
# TODO
|
||||
# attr_accessible \
|
||||
# :to,
|
||||
# :from,
|
||||
# :subject,
|
||||
# :body,
|
||||
# :recipient_count,
|
||||
# :supporter_id, :supporter,
|
||||
# :nonprofit_id,
|
||||
# :gmail_thread_id
|
||||
# :to,
|
||||
# :from,
|
||||
# :subject,
|
||||
# :body,
|
||||
# :recipient_count,
|
||||
# :supporter_id, :supporter,
|
||||
# :nonprofit_id,
|
||||
# :gmail_thread_id
|
||||
|
||||
belongs_to :supporter
|
||||
validates_presence_of :nonprofit_id
|
||||
|
|
|
@ -2,10 +2,8 @@
|
|||
|
||||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
class SupporterNote < ApplicationRecord
|
||||
# TODO
|
||||
# attr_accessible \
|
||||
# :content,
|
||||
# :supporter_id, :supporter
|
||||
# :content,
|
||||
# :supporter_id, :supporter
|
||||
|
||||
belongs_to :supporter
|
||||
has_many :activities, as: :attachment, dependent: :destroy
|
||||
|
|
|
@ -2,10 +2,8 @@
|
|||
|
||||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
class TagJoin < ApplicationRecord
|
||||
# TODO
|
||||
# attr_accessible \
|
||||
# :supporter, :supporter_id,
|
||||
# :tag_master, :tag_master_id
|
||||
# :supporter, :supporter_id,
|
||||
# :tag_master, :tag_master_id
|
||||
|
||||
validates :tag_master, presence: true
|
||||
|
||||
|
|
|
@ -2,12 +2,10 @@
|
|||
|
||||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
class TagMaster < ApplicationRecord
|
||||
# TODO:
|
||||
# attr_accessible \
|
||||
# :nonprofit, :nonprofit_id,
|
||||
# :name,
|
||||
# :deleted,
|
||||
# :created_at
|
||||
# :nonprofit, :nonprofit_id,
|
||||
# :name,
|
||||
# :deleted,
|
||||
# :created_at
|
||||
|
||||
validates :name, presence: true
|
||||
validate :no_dupes, on: :create
|
||||
|
|
|
@ -2,7 +2,10 @@
|
|||
|
||||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
class Tracking < ApplicationRecord
|
||||
# attr_accessible :utm_campaign, :utm_content, :utm_medium, :utm_source
|
||||
# :utm_campaign,
|
||||
# :utm_content,
|
||||
# :utm_medium,
|
||||
# :utm_source
|
||||
|
||||
belongs_to :donation
|
||||
end
|
||||
|
|
|
@ -2,29 +2,27 @@
|
|||
|
||||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
class User < ApplicationRecord
|
||||
# TODO:
|
||||
# attr_accessible \
|
||||
# :email, # str: balidated with Devise
|
||||
# :password, # str: hashed with bcrypt
|
||||
# :email, # str: balidated with Devise
|
||||
# :password, # str: hashed with bcrypt
|
||||
# :phone, # str
|
||||
# :location,
|
||||
# :city,
|
||||
# :state_code,
|
||||
# :password_confirmation, # accessor: used on registration
|
||||
# :remember_me, # bool: don't sign user out for a while
|
||||
# :provider, # str: OAuth provider
|
||||
# :uid, # str: OAuth user ID
|
||||
# :pending_password, # bool: User registered with oauth and did not set a password
|
||||
# :name, # str: created with oauth
|
||||
# :auto_generated, # bool: flag whether a password was auto-generated for this account
|
||||
# :referer, # str: ID of the user who referred this account
|
||||
# :latitude,
|
||||
# :longitude,
|
||||
# :reset_password_token,
|
||||
# :reset_password_sent_at,
|
||||
# :picture, # str: url for fb or twitter pic
|
||||
# :current_password, # accessor: for updating pass
|
||||
# :profile_attributes,
|
||||
# :location,
|
||||
# :city,
|
||||
# :state_code,
|
||||
# :password_confirmation, # accessor: used on registration
|
||||
# :remember_me, # bool: don't sign user out for a while
|
||||
# :provider, # str: OAuth provider
|
||||
# :uid, # str: OAuth user ID
|
||||
# :pending_password, # bool: User registered with oauth and did not set a password
|
||||
# :name, # str: created with oauth
|
||||
# :auto_generated, # bool: flag whether a password was auto-generated for this account
|
||||
# :referer, # str: ID of the user who referred this account
|
||||
# :latitude,
|
||||
# :longitude,
|
||||
# :reset_password_token,
|
||||
# :reset_password_sent_at,
|
||||
# :picture, # str: url for fb or twitter pic
|
||||
# :current_password, # accessor: for updating pass
|
||||
# :profile_attributes,
|
||||
# :phone
|
||||
|
||||
geocoded_by :location
|
||||
|
|
Loading…
Reference in a new issue