Skip to content

Commit

Permalink
Remove reference status visibility validation
Browse files Browse the repository at this point in the history
  • Loading branch information
kmycode committed Sep 19, 2023
1 parent 11300d7 commit 48b78e6
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions app/models/status_reference.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,10 @@ class StatusReference < ApplicationRecord

has_one :notification, as: :activity, dependent: :destroy

validate :validate_status_visibilities
after_commit :reset_parent_cache

private

def validate_status_visibilities
raise Mastodon::ValidationError, I18n.t('status_references.errors.invalid_status_visibilities') if [:public, :public_unlisted, :unlisted, :login].exclude?(target_status.visibility.to_sym)
end

def reset_parent_cache
Rails.cache.delete("statuses/#{status_id}")
Rails.cache.delete("statuses/#{target_status_id}")
Expand Down

0 comments on commit 48b78e6

Please sign in to comment.