This commit is contained in:
Toks
2013-07-09 13:03:51 -04:00
parent 83c6428208
commit 3afcd48925
3 changed files with 36 additions and 10 deletions

View File

@@ -30,6 +30,26 @@ module PostSets
end
end
def has_artist?
tag_array.any? && ::Artist.name_matches(tag_string).exists?
end
def artist
::Artist.name_matches(tag_string).first
end
def pool_name
tag_string.match(/^pool:(\S+)$/).try(:[], 1)
end
def has_pool?
tag_array.size == 1 && pool_name && pool
end
def pool
::Pool.find(::Pool.name_to_id(pool_name))
end
def has_deleted?
CurrentUser.is_gold? && tag_string !~ /status/ && ::Post.tag_match("#{tag_string} status:deleted").exists?
end
@@ -54,14 +74,6 @@ module PostSets
end
end
def has_artist?
tag_array.any? && ::Artist.name_matches(tag_string).exists?
end
def artist
::Artist.name_matches(tag_string).first
end
def is_single_tag?
tag_array.size == 1
end