effective_posts 0.5.5 → 0.5.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3da697da227d94719e6265fe56b2934ac7d9229e
4
- data.tar.gz: fa74411a3463ebb48b901cde5448309ad5fc78c1
3
+ metadata.gz: dc73e6efc1dae59e17429ce395a76dc3217eff18
4
+ data.tar.gz: d317017ac8c3956a5325152e7ade91108e8c915f
5
5
  SHA512:
6
- metadata.gz: 736153aa87d79f7c9f92adb958065f43f4c93d817973560987e9536b0b7f668e31aff6125b2afd8aa8503491e176b8341c62fb5a248b342fda256d2a9e1c6113
7
- data.tar.gz: fd4f2df6bbe4b8a944737b02ac924991de81d4d86015f7d96ee6cb74d17c5f91d18f5c8ba6e9f27476e579bdb8a371308878b717d4a37606d69a495e51b91e7c
6
+ metadata.gz: ea3271eacf7ec10f19406aa763b2f1b3391076389fbe759c3a7e581b022fe70424b3caf65165e9e0ea360863e123b6a8ac2d24ce4ab8f97adc2cfcfd0cda382f
7
+ data.tar.gz: e7e0ced1e4cf15ad530affcfd8e620456366b4d6e49b05fda965a25460607dd73011bd8710c92037d98713461f8ceade4827aba57806b51083473a982773951c
@@ -71,16 +71,27 @@ module EffectivePostsHelper
71
71
 
72
72
  ### Recent Posts
73
73
 
74
- def recent_posts(user: current_user, category: 'posts', limit: EffectivePosts.per_page)
74
+ def recent_posts(user: current_user, category: nil, limit: EffectivePosts.per_page)
75
75
  @recent_posts ||= {}
76
76
  @recent_posts[category] ||= Effective::Post.posts(user: user, category: category).limit(limit)
77
77
  end
78
78
 
79
- def render_recent_posts(user: current_user, category: 'posts', limit: EffectivePosts.per_page)
79
+ def render_recent_posts(user: current_user, category: nil, limit: EffectivePosts.per_page)
80
80
  posts = recent_posts(user: user, category: category, limit: limit)
81
81
  render partial: '/effective/posts/recent_posts', locals: { posts: posts }
82
82
  end
83
83
 
84
+ ### Recent News
85
+ def recent_news(user: current_user, category: 'news', limit: EffectivePosts.per_page)
86
+ @recent_news ||= {}
87
+ @recent_news[category] ||= Effective::Post.posts(user: user, category: category).limit(limit)
88
+ end
89
+
90
+ def render_recent_news(user: current_user, category: 'news', limit: EffectivePosts.per_page)
91
+ posts = recent_news(user: user, category: category, limit: limit)
92
+ render partial: '/effective/posts/recent_posts', locals: { posts: posts }
93
+ end
94
+
84
95
  ### Upcoming Events
85
96
 
86
97
  def upcoming_events(user: current_user, category: 'events', limit: EffectivePosts.per_page)
@@ -1,4 +1,4 @@
1
- class CreateEffectivePosts < ActiveRecord::Migration
1
+ class CreateEffectivePosts < ActiveRecord::Migration[4.2]
2
2
  def self.up
3
3
  create_table <%= @posts_table_name %> do |t|
4
4
  t.integer :user_id
@@ -1,3 +1,3 @@
1
1
  module EffectivePosts
2
- VERSION = '0.5.5'.freeze
2
+ VERSION = '0.5.6'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_posts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-23 00:00:00.000000000 Z
11
+ date: 2017-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails