style(models): normalize comments style

This commit is contained in:
Luis Castro 2019-08-06 16:08:51 +02:00 committed by Eric Schultz
parent fa77979712
commit c64adad9ad
25 changed files with 171 additions and 184 deletions

View file

@ -2,7 +2,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 DirectDebitDetail < ApplicationRecord 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 :donations
has_many :charges has_many :charges

View file

@ -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 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 Statuses = %i[needs_response under_review won lost lost_and_paid].freeze
# TODO # :gross_amount, # int
# attr_accessible \ # :charge_id,
# :gross_amount, # int # :charge,
# :charge_id, :charge, # :payment_id,
# :payment_id, :payment, # :payment,
# :status, # :status,
# :reason # :reason
belongs_to :charge belongs_to :charge
belongs_to :payment belongs_to :payment

View file

@ -2,13 +2,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 EmailDraft < ApplicationRecord class EmailDraft < ApplicationRecord
# TODO # :nonprofit, :nonprofit_id,
# attr_accessible \ # :name,
# :nonprofit, :nonprofit_id, # :deleted,
# :name, # :value,
# :deleted, # :created_at
# :value,
# :created_at
belongs_to :nonprofit belongs_to :nonprofit

View file

@ -2,8 +2,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 Export < ApplicationRecord class Export < ApplicationRecord
# :exception,
# :nonprofit,
# :status,
# :user,
# :export_type,
# :parameters,
# :ended,
# :url,
# :user_id,
# :nonprofit_id
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
belongs_to :nonprofit belongs_to :nonprofit
belongs_to :user belongs_to :user

View file

@ -2,18 +2,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 FullContactInfo < ApplicationRecord class FullContactInfo < ApplicationRecord
# 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,
# :age_range,
# :location_general, # :location_general,
# :supporter_id, :supporter, # :supporter_id, :supporter,
# :websites # :websites

View file

@ -2,16 +2,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 FullContactOrg < ApplicationRecord class FullContactOrg < ApplicationRecord
# 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
end end

View file

@ -2,13 +2,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 FullContactPhoto < ApplicationRecord class FullContactPhoto < ApplicationRecord
# 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

@ -2,15 +2,13 @@
# 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
# 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

@ -2,11 +2,9 @@
# 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
# 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
end end

View file

@ -2,7 +2,8 @@
# 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 < ApplicationRecord class ImageAttachment < ApplicationRecord
attr_accessible :parent_id, :file # :parent_id,
# :file
mount_uploader :file, ImageAttachmentUploader mount_uploader :file, ImageAttachmentUploader
# not sure if poly parent is used on this model, as all values are nil in db # not sure if poly parent is used on this model, as all values are nil in db

View file

@ -2,8 +2,6 @@
# 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
# TODO
# attr_accessible \
# :donate_again_url, # :donate_again_url,
# :change_amount_message # :change_amount_message

View file

@ -2,10 +2,8 @@
# 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
# 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

@ -2,7 +2,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 OffsitePayment < ApplicationRecord class OffsitePayment < ApplicationRecord
# attr_accessible :gross_amount, :kind, :date, :check_number # :gross_amount,
# :kind,
# :date,
# :check_number
belongs_to :payment, dependent: :destroy belongs_to :payment, dependent: :destroy
belongs_to :donation belongs_to :donation
belongs_to :nonprofit belongs_to :nonprofit

View file

@ -6,14 +6,12 @@
# 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 < ApplicationRecord class Payment < ApplicationRecord
# 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

@ -14,12 +14,10 @@
# 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 < ApplicationRecord class PaymentPayout < ApplicationRecord
# 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

@ -7,21 +7,19 @@
# These are tied to Stripe transfers # These are tied to Stripe transfers
class Payout < ApplicationRecord class Payout < ApplicationRecord
# 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

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

View file

@ -3,7 +3,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 SourceToken < ApplicationRecord class SourceToken < ApplicationRecord
self.primary_key = :token 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 :tokenizable, polymorphic: true
belongs_to :event belongs_to :event
end end

View file

@ -2,34 +2,32 @@
# 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
# 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

@ -2,16 +2,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 SupporterEmail < ApplicationRecord class SupporterEmail < ApplicationRecord
# 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

@ -2,10 +2,8 @@
# 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
# 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

@ -2,10 +2,8 @@
# 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
# 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

@ -2,12 +2,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 TagMaster < ApplicationRecord class TagMaster < ApplicationRecord
# 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

@ -2,7 +2,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 Tracking < ApplicationRecord class Tracking < ApplicationRecord
# attr_accessible :utm_campaign, :utm_content, :utm_medium, :utm_source # :utm_campaign,
# :utm_content,
# :utm_medium,
# :utm_source
belongs_to :donation belongs_to :donation
end end

View file

@ -2,29 +2,27 @@
# 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
# TODO: # :email, # str: balidated with Devise
# attr_accessible \ # :password, # str: hashed with bcrypt
# :email, # str: balidated with Devise
# :password, # str: hashed with bcrypt
# :phone, # str # :phone, # str
# :location, # :location,
# :city, # :city,
# :state_code, # :state_code,
# :password_confirmation, # accessor: used on registration # :password_confirmation, # accessor: used on registration
# :remember_me, # bool: don't sign user out for a while # :remember_me, # bool: don't sign user out for a while
# :provider, # str: OAuth provider # :provider, # str: OAuth provider
# :uid, # str: OAuth user ID # :uid, # str: OAuth user ID
# :pending_password, # bool: User registered with oauth and did not set a password # :pending_password, # bool: User registered with oauth and did not set a password
# :name, # str: created with oauth # :name, # str: created with oauth
# :auto_generated, # bool: flag whether a password was auto-generated for this account # :auto_generated, # bool: flag whether a password was auto-generated for this account
# :referer, # str: ID of the user who referred this account # :referer, # str: ID of the user who referred this account
# :latitude, # :latitude,
# :longitude, # :longitude,
# :reset_password_token, # :reset_password_token,
# :reset_password_sent_at, # :reset_password_sent_at,
# :picture, # str: url for fb or twitter pic # :picture, # str: url for fb or twitter pic
# :current_password, # accessor: for updating pass # :current_password, # accessor: for updating pass
# :profile_attributes, # :profile_attributes,
# :phone # :phone
geocoded_by :location geocoded_by :location