Method: ApplicationHelper#promoted_posts
- Defined in:
- app/helpers/application_helper.rb
#promoted_posts ⇒ Hash{Integer => Integer}
Get a list of network promoted posts, ignoring expired entries.
270 271 272 273 |
# File 'app/helpers/application_helper.rb', line 270 def promoted_posts JSON.parse(RequestContext.redis.get('network/promoted_posts') || '{}') .select { |_k, v| DateTime.now.to_i - v <= 3600 * 24 * 28 } end |