From ab53b485b4ea78abec0d81c7de08aa5a3726a8f4 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 21 Oct 2019 13:44:14 -0400 Subject: [PATCH] Add setter for `excerpt_size` so plugins can set it more easily --- app/models/post.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/post.rb b/app/models/post.rb index 2462b5abb61..06c71b524c9 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -157,8 +157,12 @@ class Post < ActiveRecord::Base includes(:post_details).find_by(post_details: { key: key, value: value }) end + def self.excerpt_size=(sz) + @excerpt_size = sz + end + def self.excerpt_size - 220 + @excerpt_size || 220 end def whisper?