Allow the topic excerpt size to be customizable by plugins
This commit is contained in:
parent
6e9c8fe854
commit
f14020dd0a
|
@ -157,6 +157,10 @@ class Post < ActiveRecord::Base
|
||||||
includes(:post_details).find_by(post_details: { key: key, value: value })
|
includes(:post_details).find_by(post_details: { key: key, value: value })
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.excerpt_size
|
||||||
|
220
|
||||||
|
end
|
||||||
|
|
||||||
def whisper?
|
def whisper?
|
||||||
post_type == Post.types[:whisper]
|
post_type == Post.types[:whisper]
|
||||||
end
|
end
|
||||||
|
@ -463,7 +467,7 @@ class Post < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def excerpt_for_topic
|
def excerpt_for_topic
|
||||||
Post.excerpt(cooked, 220, strip_links: true, strip_images: true, post: self)
|
Post.excerpt(cooked, Post.excerpt_size, strip_links: true, strip_images: true, post: self)
|
||||||
end
|
end
|
||||||
|
|
||||||
def is_first_post?
|
def is_first_post?
|
||||||
|
|
Loading…
Reference in New Issue