Module: Spree::PageSections::FeaturedPostsDecorator

Defined in:
app/decorators/spree/page_sections/featured_posts_decorator.rb

Instance Method Summary collapse

Instance Method Details

#retrieve_postsObject



6
7
8
9
10
11
12
# File 'app/decorators/spree/page_sections/featured_posts_decorator.rb', line 6

def retrieve_posts
  Spree::Post.where(store: store)
             .where("published_at < ?", Time.zone.now.utc)
             .order(id: :desc)
             .includes(:post_category)
             .limit(preferred_max_posts_to_show)
end