chore(models): comment out attr_accessible

Needs to be changed to strong params in controllers of each model.
This commit is contained in:
Luis Castro 2019-07-23 21:22:00 +02:00
parent 84f8a583ba
commit df29d446ae
No known key found for this signature in database
GPG key ID: 0A8F33D4C4E27639
10 changed files with 19 additions and 19 deletions

View file

@ -1,10 +1,10 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class Coupon < ApplicationRecord
attr_accessible \
:name,
:victim_np_id,
:paid, # boolean
:nonprofit, :nonprofit_id
# attr_accessible \
# :name,
# :victim_np_id,
# :paid, # boolean
# :nonprofit, :nonprofit_id
scope :unpaid, -> {where(paid: [nil,false])}

View file

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

View file

@ -1,6 +1,6 @@
# 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
# attr_accessible :iban, :account_holder_name, :bic, :supporter_id, :holder
has_many :donations
has_many :charges

View file

@ -1,6 +1,6 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
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 :tag_master
end

View file

@ -2,7 +2,7 @@
class Export < ApplicationRecord
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
belongs_to :nonprofit
belongs_to :user

View file

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

View file

@ -1,6 +1,6 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class PaymentImport < ApplicationRecord
attr_accessible :nonprofit, :user
# attr_accessible :nonprofit, :user
has_and_belongs_to_many :donations
belongs_to :nonprofit
belongs_to :user

View file

@ -1,7 +1,7 @@
# 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
# attr_accessible :expiration, :token, :max_uses, :total_uses
belongs_to :tokenizable, :polymorphic => true
belongs_to :event
end

View file

@ -1,7 +1,7 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class Ticket < ApplicationRecord
attr_accessible :note, :event_discount, :event_discount_id
# attr_accessible :note, :event_discount, :event_discount_id
belongs_to :event_discount
belongs_to :supporter

View file

@ -1,6 +1,6 @@
# 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
# attr_accessible :utm_campaign, :utm_content, :utm_medium, :utm_source
belongs_to :donation
end