diff --git a/app/models/post.rb b/app/models/post.rb index 68d6f0b9b..0fd495965 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -51,7 +51,9 @@ class Post < ActiveRecord::Base scope :public_posts, -> { joins(:topic).where('topics.archetype <> ?', Archetype.private_message) } scope :private_posts, -> { joins(:topic).where('topics.archetype = ?', Archetype.private_message) } scope :with_topic_subtype, ->(subtype) { joins(:topic).where('topics.subtype = ?', subtype) } - + + delegate :username, to: :user + def self.hidden_reasons @hidden_reasons ||= Enum.new(:flag_threshold_reached, :flag_threshold_reached_again, :new_user_spam_threshold_reached) end @@ -215,10 +217,6 @@ class Post < ActiveRecord::Base cooked end - def username - user.username - end - def external_id "#{topic_id}/#{post_number}" end