phcpress 2.7.5 → 2.8.0

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: 9ddfc7b39959705afb53208742b26a077400773b
4
- data.tar.gz: 926b72d2f541d6b8f6330a39ab7ee7c22c3c0e81
3
+ metadata.gz: ffbd9973cfe2f102d8daf206d78869f04491bb40
4
+ data.tar.gz: 9906e3c36ff98579d9053fa767556bd6cd85b896
5
5
  SHA512:
6
- metadata.gz: 4808c9c2384a0abd72025d04fc87e10a417817d6d8bb41f62ff77a33ac7f61f1c9c299477425e0c8de663dd753008b1644d7be30b0f49601cccbddb0ab662d1b
7
- data.tar.gz: 464a149ee4d39926c17f3488de7545b767d1db35f363bbeb909e9c3d0922b6389db7b1aac84e3abfc43653eecaf9d22abf1181103fdb5c0259ec527b19e67d7c
6
+ metadata.gz: fa4f1a3997acfdde30953e266ae1eac4662ef6d4eec4e0ab3b4f8a264b3f4e70324f439372ad6648cc5f3ced312be8329de31652cc474c98c6ec1cb6e095b848
7
+ data.tar.gz: 5568c6ce8e638d9a34cb0f6c450cb5cc3c2683b681af461eea416226467e8c5a32730a5ea568102620ea52a45f3bdf6c3f2097898130cd32e0753d02e1d97ab5
data/README.md CHANGED
@@ -3,12 +3,12 @@
3
3
  [![Issue Count](https://codeclimate.com/github/PHCNetworks/phc-press/badges/issue_count.svg)](https://codeclimate.com/github/PHCNetworks/phc-press)
4
4
  [![Gem Version](https://badge.fury.io/rb/phcpress.svg)](https://badge.fury.io/rb/phcpress)
5
5
 
6
- ### PHC-Press (Blog & News Post Engine) Documentation
7
- PHC-Press is an opensource news and blog posting engine purpose built for PHCPress application.
6
+ ### PHCPress(2) (Blog & News Post Engine) Documentation
7
+ PHCPress is an open source news & blog engine built for PHCPress application
8
8
 
9
9
  #### Step 1 - Add PHCPress to your gemfile
10
10
 
11
- gem 'phcpress', '~> 2.6', '>= 2.6.6'
11
+ gem 'phcpress', '~> 2.7', '>= 2.7.5'
12
12
  bundle exec install
13
13
 
14
14
  #### Step 2 - Add PHCPress database migration files
@@ -1,5 +1,6 @@
1
1
  module Phcpress
2
2
  class ApplicationController < ActionController::Base
3
3
  protect_from_forgery with: :exception
4
+
4
5
  end
5
6
  end
@@ -30,6 +30,7 @@ module Phcpress
30
30
 
31
31
  # POST
32
32
  def create
33
+ @blog_post.user_id = current_user
33
34
  @blog_post = Blog::Post.new(blog_post_params)
34
35
 
35
36
  if @blog_post.save
@@ -21,7 +21,7 @@ module Phcpress
21
21
 
22
22
  # Create a New News Post (/news/posts/new)
23
23
  def new
24
- @news_post = News::Post.scoped_to(current_account).new
24
+ @news_post = current_user.News::Post.new
25
25
  end
26
26
 
27
27
  # Edit News Post /news/posts/1/edit
@@ -30,7 +30,7 @@ module Phcpress
30
30
 
31
31
  # POST
32
32
  def create
33
- @news_post = News::Post.current_user.(news_post_params)
33
+ @news_post = current_user.News::Post.(news_post_params)
34
34
 
35
35
  if @news_post.save
36
36
  redirect_to news_posts_path, notice: 'News post was successfully created.'
@@ -1,10 +1,8 @@
1
1
  module Phcpress
2
2
  class Blog::Post < ActiveRecord::Base
3
3
 
4
- # Define scoped_to for Devise
5
- def scoped_to(account)
6
- where(:user_id => current_user.id)
7
- end
4
+ # Filters Before Post
5
+ before_create :authour
8
6
 
9
7
  # For Image Uploads
10
8
  mount_uploader :pstimage, Phcpress::PstimageUploader
@@ -12,5 +10,10 @@ module Phcpress
12
10
  # Associate Post Authour to User
13
11
  belongs_to :user
14
12
 
13
+ # Define r Devise
14
+ def authour
15
+ self.user_id = current_user.id
16
+ end
17
+
15
18
  end
16
19
  end
@@ -1,16 +1,19 @@
1
1
  module Phcpress
2
2
  class News::Post < ActiveRecord::Base
3
3
 
4
- # Define scoped_to for Devise
5
- def scoped_to(account)
6
- where(:user_id => current_user.id)
7
- end
4
+ # Filters Before Post
5
+ before_create :authour
8
6
 
9
7
  # For Image Uploads
10
8
  mount_uploader :pstimage, Phcpress::PstimageUploader
11
9
 
12
10
  # Associate Post Authour to User
13
11
  belongs_to :user
12
+
13
+ # Define r Devise
14
+ def authour
15
+ self.user_id = current_user.id
16
+ end
14
17
 
15
18
  end
16
19
  end
@@ -1,3 +1,3 @@
1
1
  module Phcpress
2
- VERSION = "2.7.5"
2
+ VERSION = "2.8.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phcpress
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.5
4
+ version: 2.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - BradPotts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-19 00:00:00.000000000 Z
11
+ date: 2016-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -290,8 +290,7 @@ dependencies:
290
290
  - - "~>"
291
291
  - !ruby/object:Gem::Version
292
292
  version: 0.5.0
293
- description: PHC-Press is an open source news and blog posting engine purpose built
294
- for PHCPress application.
293
+ description: PHCPress is an open source news & blog engine built for PHCPress application
295
294
  email:
296
295
  - info@phcnetworks.net
297
296
  executables: []
@@ -360,5 +359,5 @@ rubyforge_project:
360
359
  rubygems_version: 2.5.1
361
360
  signing_key:
362
361
  specification_version: 4
363
- summary: News & Blog Posts Engine for Ruby on Rails
362
+ summary: News & Blog Posts Engin
364
363
  test_files: []