* Ensure verify_authorized in internal * Create internal_policy * Replace ArticlePolicy usage with InternalPolicy * Replace BufferUpdate&CommentPolicy with InternalPolicy * Remove verbose authorize_admin * Forgot to remove coresponding specs * Create specs for InternalPolicy * Expand policy access on internal's broadcast * Refactor * Create shared spec * Create request specs * Add additional test cases
12 lines
341 B
Ruby
12 lines
341 B
Ruby
class Broadcast < ApplicationRecord
|
|
resourcify
|
|
|
|
has_many :notifications, as: :notifiable, inverse_of: :notifiable
|
|
|
|
validates :title, :type_of, :processed_html, presence: true
|
|
validates :type_of, inclusion: { in: %w[Announcement Onboarding] }
|
|
|
|
def get_inner_body(content)
|
|
Nokogiri::HTML(content).at("body").inner_html
|
|
end
|
|
end
|