split out tag_relationship has_one relationship on forum post to alias/impication (#3686)
This commit is contained in:
@@ -6,7 +6,8 @@ class ForumPost < ApplicationRecord
|
|||||||
belongs_to_updater
|
belongs_to_updater
|
||||||
belongs_to :topic, :class_name => "ForumTopic"
|
belongs_to :topic, :class_name => "ForumTopic"
|
||||||
has_many :votes, class_name: "ForumPostVote"
|
has_many :votes, class_name: "ForumPostVote"
|
||||||
has_one :tag_relationship
|
has_one :tag_alias
|
||||||
|
has_one :tag_implication
|
||||||
has_one :bulk_update_request
|
has_one :bulk_update_request
|
||||||
before_validation :initialize_is_deleted, :on => :create
|
before_validation :initialize_is_deleted, :on => :create
|
||||||
after_create :update_topic_updated_at_on_create
|
after_create :update_topic_updated_at_on_create
|
||||||
@@ -133,7 +134,7 @@ class ForumPost < ApplicationRecord
|
|||||||
|
|
||||||
def votable?
|
def votable?
|
||||||
# shortcut to eliminate posts that are probably not tag change requests
|
# shortcut to eliminate posts that are probably not tag change requests
|
||||||
body =~ /->/ && (bulk_update_request.present? || tag_relationship.present?) && created_at >= TagRelationship::EXPIRY.days.ago
|
body =~ /->/ && (bulk_update_request.present? || tag_alias.present? || tag_implication.present?) && created_at >= TagRelationship::EXPIRY.days.ago
|
||||||
end
|
end
|
||||||
|
|
||||||
def voted?(user, score)
|
def voted?(user, score)
|
||||||
|
|||||||
Reference in New Issue
Block a user