Ensure that the custom_teaser column exists before trying to use it incase the migration hasn't been generated/run.
This commit is contained in:
parent
05731559a0
commit
eb4b64a65b
1 changed files with 3 additions and 4 deletions
|
@ -43,14 +43,13 @@ module BlogPostsHelper
|
|||
end
|
||||
|
||||
def blog_post_teaser(post)
|
||||
if post.custom_teaser.present?
|
||||
if post.respond_to?(:custom_teaser) && post.custom_teaser.present?
|
||||
post.custom_teaser.html_safe
|
||||
else
|
||||
truncate(
|
||||
post.body,
|
||||
truncate(post.body, {
|
||||
:length => RefinerySetting.find_or_set(:blog_post_teaser_length, 250),
|
||||
:preserve_html_tags => true
|
||||
).html_safe
|
||||
}).html_safe
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue