app/presenters: remove unused forum_post/note/post_version presenters.

This commit is contained in:
evazion
2017-02-06 02:23:51 -06:00
parent 5c16e9ce48
commit ec653dce71
6 changed files with 0 additions and 49 deletions

View File

@@ -158,10 +158,6 @@ class ForumTopic < ActiveRecord::Base
(response_count / Danbooru.config.posts_per_page.to_f).ceil
end
def presenter(forum_posts)
@presenter ||= ForumTopicPresenter.new(self, forum_posts)
end
def as_json(options = {})
if CurrentUser.user.level < min_level
options[:only] = [:id]

View File

@@ -89,10 +89,6 @@ class Note < ActiveRecord::Base
extend SearchMethods
include ApiMethods
def presenter
@presenter ||= NotePresenter.new(self)
end
def initialize_creator
self.creator_id = CurrentUser.id
end

View File

@@ -56,10 +56,6 @@ class PostVersion < ActiveRecord::Base
@tag_array ||= tags.scan(/\S+/)
end
def presenter
PostVersionPresenter.new(self)
end
def reload
@tag_array = nil
super

View File

@@ -1,8 +0,0 @@
class ForumTopicPresenter < Presenter
attr_reader :forum_topic, :forum_posts
def initialize(forum_topic, forum_posts)
@forum_posts = forum_posts
@forum_topic = forum_topic
end
end

View File

@@ -1,9 +0,0 @@
class NotePresenter
def initialize(note)
@note = note
end
def formatted_body
note.body.gsub(/<tn>(.+?)<\/tn>/m, '<br><p class="tn">\1</p>').gsub(/\n/, '<br>')
end
end

View File

@@ -1,20 +0,0 @@
class PostVersionPresenter < Presenter
attr_reader :post_version
def initialize(post_version)
@post_version = post_version
end
def changes
html = []
html << post_version.tag_array
html << "<ins>source:#{h(post_version.source)}</ins>" if post_version.source
html << "<ins>rating:#{h(post_version.rating)}</ins>" if post_version.rating
html << "<ins>parent:#{post_version.parent_id}</ins>" if post_version.parent_id
html.join(" ").html_safe
end
def updater_name
User.id_to_name(post_version.updater_id)
end
end