dtext: refactor parsing of embedded BUR pseudo tags.
This commit is contained in:
@@ -137,14 +137,6 @@ class BulkUpdateRequest < ApplicationRecord
|
||||
include ApprovalMethods
|
||||
include ValidationMethods
|
||||
|
||||
concerning :EmbeddedText do
|
||||
class_methods do
|
||||
def embedded_pattern
|
||||
/\[bur:(?<id>\d+)\]/m
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def editable?(user)
|
||||
user_id == user.id || user.is_builder?
|
||||
end
|
||||
|
||||
@@ -33,14 +33,6 @@ class TagAlias < TagRelationship
|
||||
include ApprovalMethods
|
||||
include ForumMethods
|
||||
|
||||
concerning :EmbeddedText do
|
||||
class_methods do
|
||||
def embedded_pattern
|
||||
/\[ta:(?<id>\d+)\]/m
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def self.to_aliased(names)
|
||||
names = Array(names).map(&:to_s)
|
||||
return [] if names.empty?
|
||||
|
||||
@@ -191,14 +191,6 @@ class TagImplication < TagRelationship
|
||||
include ValidationMethods
|
||||
include ApprovalMethods
|
||||
|
||||
concerning :EmbeddedText do
|
||||
class_methods do
|
||||
def embedded_pattern
|
||||
/\[ti:(?<id>\d+)\]/m
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def reload(options = {})
|
||||
flush_cache
|
||||
super
|
||||
|
||||
@@ -177,14 +177,6 @@ class TagRelationship < ApplicationRecord
|
||||
end
|
||||
end
|
||||
|
||||
concerning :EmbeddedText do
|
||||
class_methods do
|
||||
def embedded_pattern
|
||||
raise NotImplementedError
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def antecedent_and_consequent_are_different
|
||||
if antecedent_name == consequent_name
|
||||
errors[:base] << "Cannot alias or implicate a tag to itself"
|
||||
|
||||
Reference in New Issue
Block a user