Skip to content

Commit a08b299

Browse files
committed
Remove attr_protected from multiple models:
- Switches - SystemName - Finance::BillingStrategy - Alert - Forum - Invitation - MessageRecipient - Metric - Moderatorship - PaymentDetail - PaymentTransaction - PlanMetric - Profile - Topic - TopicCategory - UserTopic
1 parent aab7a14 commit a08b299

16 files changed

Lines changed: 0 additions & 28 deletions

app/lib/switches.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ def assign_switches(*switch_names)
164164
included do
165165
SWITCHES.each do |name|
166166
attr_name = "#{name}_switch"
167-
attr_protected attr_name
168167

169168
# Switches State Machine
170169
#

app/lib/system_name.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ def validates_system_name(opts = {})
2020
end
2121

2222
def has_system_name(opts = {})
23-
attr_protected :system_name if opts.delete(:protected)
2423
self._system_human_name = opts.delete(:human_name) || :name
2524
validates_system_name(opts)
2625
end

app/models/alert.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ class Alert < ApplicationRecord
1515

1616
has_one :user_account, through: :cinstance
1717

18-
attr_protected :account_id, :cinstance_id, :tenant_id
19-
2018
validates :account, :timestamp, :state, presence: true
2119
validates :utilization, :level, :alert_id, :cinstance, presence: true
2220
validates :alert_id, uniqueness: { scope: :account_id, case_sensitive: true }

app/models/finance/billing_strategy.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ class << self
2020
belongs_to :account
2121
alias_method :provider, :account
2222

23-
attr_protected :account_id, :tenant_id, :audit_ids
24-
2523
accepts_nested_attributes_for :account
2624
validates :currency, inclusion: { in: CURRENCIES.values, message: :invalid }
2725

app/models/forum.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ class Forum < ApplicationRecord
2727

2828
scope :ordered, -> { order('position') }
2929

30-
attr_protected :topics_count, :posts_count, :account_id, :tenant_id
31-
3230
def latest_posts
3331
posts.joins(:topic).order('posts.created_at DESC')
3432
end

app/models/invitation.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ class Invitation < ApplicationRecord
1818
# so after first call it sets the sent_at attribute and breaks the infinite loop
1919
after_commit :notify_invitee, :on => :create, :unless => :sent?
2020

21-
attr_protected :accepted_at, :tenant_id
22-
2321
default_scope -> { ordering { System::Database.oracle? ? sent_at.desc.op('', sql('NULLS LAST')) : sent_at.desc } }
2422

2523
scope :pending, -> { where(accepted_at: nil) }

app/models/message_recipient.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ class MessageRecipient < ApplicationRecord
2929
validates :message_id, :kind, :receiver_id, :receiver_type, presence: true
3030
validates :receiver_type, :kind, :state, length: { maximum: 255 }
3131

32-
attr_protected :message_id, :receiver_id, :receiver_type, :tenant_id
33-
3432
# Make this class look like the actual message
3533
delegate :sender, :subject, :body, :recipients, :to, :cc, :bcc, :created_at, :sender_name,
3634
:to => :message

app/models/metric.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ class Metric < ApplicationRecord
2626

2727
acts_as_tree
2828

29-
attr_protected :service_id, :parent_id, :tenant_id, :audit_ids
3029
validates :unit, presence: true, unless: :child?
3130
validates :friendly_name, uniqueness: { scope: %i[owner_type owner_id], case_sensitive: true }, presence: true
3231
validates :system_name, :unit, :friendly_name, :owner_type, length: { maximum: 255 }

app/models/moderatorship.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ class Moderatorship < ApplicationRecord
44
validates :user_id, :forum_id, presence: true
55
validate :uniqueness_of_relationship
66

7-
attr_protected :forum_id, :user_id, :tenant_id
8-
97
protected
108

119
def uniqueness_of_relationship

app/models/payment_detail.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ class PaymentDetail < ApplicationRecord
1212

1313
audited allow_mass_assignment: true
1414

15-
attr_protected :account_id, :audit_ids
16-
1715
validates :credit_card_partial_number, length: { :maximum => 4,
1816
:allow_blank => true,
1917
:message => "must be the final 4 digits only" }

0 commit comments

Comments
 (0)