phcpresspro 4.1.8 → 4.1.9

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: 4e5518a5c76e2630c189fef3248652c27a71a037
4
- data.tar.gz: 68c6a49de440bb25da939e3f5ac2faf4b8f4c79d
3
+ metadata.gz: 34205d4ef7d043b25606391d53a3459e7e9d9e01
4
+ data.tar.gz: d3315ffff71dc4d181496b2a1399dff948f3cdec
5
5
  SHA512:
6
- metadata.gz: 3f0cc17cc48b0f50b2a3caa6f60443fde64c27c1319b803c4acf15982e069698782f557002fa4a53f64d08c91b4ad424725b134129b58d3ec81278d2172b7bd7
7
- data.tar.gz: f439c3956eeef510834e57ba39c4a64a7fd23a3646be9f28c4c8f25f7dcc3d528fe7ec16d82f104295fd4900d37e8aacc4243b7808ea508ee4688320457b401c
6
+ metadata.gz: f160f65157912bff4d78b7bd9bd5aa1a86081f9115ea5d788ed8e45cc9a569b1842ddd419c1ec2be456f1df3400c917f9664cab82587b1fbff62e1c011a68673
7
+ data.tar.gz: 9dca3635fefb18428a018603eed8e02ea1fb49aad0821043c0f321d43f4613187940edf157c53e2f73c53d8aaf40f0805f808ef876177422a1632c97e5f918aa
@@ -6,31 +6,31 @@ module Phcpresspro
6
6
  # Filters & Security
7
7
  before_action :set_articles_post, only: [:show, :edit, :update, :destroy]
8
8
 
9
- # Article Post Index (/articles/posts)
9
+ # Article Index
10
10
  def index
11
11
  @articles_posts = Articles::Post.all
12
12
  end
13
13
 
14
- # Single Article Post (/articles/posts/1)
14
+ # Article Show
15
15
  def show
16
16
  end
17
17
 
18
- # Create a New Article Post (/articles/posts/new)
18
+ # Article New
19
19
  def new
20
20
  @articles_post = Articles::Post.new
21
+
21
22
  end
22
23
 
23
- # Edit Article Post (/articles/posts/1/edit)
24
+ # Article Edit
24
25
  def edit
25
26
  end
26
27
 
27
28
  # POST
28
29
  def create
29
30
  @articles_post = Articles::Post.new(articles_post_params)
30
-
31
31
  if @articles_post.save
32
32
  @articles_post.connections.build
33
- redirect_to @articles_post, notice: 'Post was successfully created.'
33
+ redirect_to articles_posts_url, notice: 'Post was successfully created.'
34
34
  else
35
35
  render :new
36
36
  end
@@ -40,7 +40,7 @@ module Phcpresspro
40
40
  def update
41
41
  if @articles_post.update(articles_post_params)
42
42
  @articles_post.connections.build
43
- redirect_to @articles_post, notice: 'Post was successfully updated.'
43
+ redirect_to articles_posts_url, notice: 'Post was successfully updated.'
44
44
  else
45
45
  render :edit
46
46
  end
@@ -59,9 +59,9 @@ module Phcpresspro
59
59
  @articles_post = Articles::Post.find(params[:id])
60
60
  end
61
61
 
62
- # Whitelists
62
+ # Params Whitelist
63
63
  def articles_post_params
64
- params.require(:articles_post).permit(:psttitle, :psttext, :pstexcerpts, :pststatus, :pstcategory, :pstimage, :remove_pstimage, :user_id, :membership_id, :oganization_id)
64
+ params.require(:articles_post).permit(:psttitle, :psttext, :pstexcerpts, :pststatus, :pstimage, :remove_pstimage, category_ids: [])
65
65
  end
66
66
 
67
67
  end
@@ -11,22 +11,23 @@ module Phcpresspro
11
11
  @modules_categories = Modules::Category.all
12
12
  end
13
13
 
14
- # Detail News/Blog Category
14
+ # Categories Show
15
15
  def show
16
16
  end
17
17
 
18
- # New News/Blog Category
18
+ # Categories New
19
19
  def new
20
20
  @modules_category = Modules::Category.new
21
21
  end
22
22
 
23
- # Edit News/Blog Category
23
+ # Categories Edit
24
24
  def edit
25
25
  end
26
26
 
27
- # Create News/Blog Category
27
+ # POST
28
28
  def create
29
29
  @modules_category = Modules::Category.new(modules_category_params)
30
+
30
31
  if @modules_category.save
31
32
  redirect_to modules_categories_url, notice: 'Category was successfully created.'
32
33
  else
@@ -34,7 +35,7 @@ module Phcpresspro
34
35
  end
35
36
  end
36
37
 
37
- # Update News/Blog Category
38
+ # PATCH/PUT
38
39
  def update
39
40
  if @modules_category.update(modules_category_params)
40
41
  redirect_to modules_categories_url, notice: 'Category was successfully updated.'
@@ -43,7 +44,7 @@ module Phcpresspro
43
44
  end
44
45
  end
45
46
 
46
- # Delete News/Blog Category
47
+ # DELETE
47
48
  def destroy
48
49
  @modules_category.destroy
49
50
  redirect_to modules_categories_url, notice: 'Category was successfully destroyed.'
@@ -58,7 +59,7 @@ module Phcpresspro
58
59
 
59
60
  # Whitelist
60
61
  def modules_category_params
61
- params.require(:modules_category).permit(:catname, :user_id, :membership_id, :oganization_id)
62
+ params.require(:modules_category).permit(:catname)
62
63
  end
63
64
 
64
65
  end
@@ -1,64 +1,66 @@
1
1
  require_dependency "phcpresspro/application_controller"
2
2
 
3
3
  module Phcpresspro
4
- class Modules::ConnectionsController < ApplicationController
5
- before_action :set_modules_connection, only: [:show, :edit, :update, :destroy]
4
+ class Modules::ConnectionsController < ApplicationController
6
5
 
7
- # GET /modules/connections
8
- def index
9
- @modules_connections = Modules::Connection.all
10
- end
6
+ # Security and Filters
7
+ before_action :set_modules_connection, only: [:show, :edit, :update, :destroy]
11
8
 
12
- # GET /modules/connections/1
13
- def show
14
- end
9
+ # Connections Index
10
+ def index
11
+ @modules_connections = Modules::Connection.all
12
+ end
15
13
 
16
- # GET /modules/connections/new
17
- def new
18
- @modules_connection = Modules::Connectionn.new
19
- @modules_connection.posts.build
20
- @modules_connection.categories.build
21
- end
14
+ # Connections Show
15
+ def show
16
+ end
22
17
 
23
- # GET /modules/connections/1/edit
24
- def edit
25
- end
18
+ # Connections New
19
+ def new
20
+ @modules_connection = Modules::Connection.new
21
+ end
26
22
 
27
- # POST /modules/connections
28
- def create
29
- @modules_connection = Modules::Connection.new(modules_connection_params)
23
+ # Connections Edit
24
+ def edit
25
+ end
30
26
 
31
- if @modules_connection.save
32
- redirect_to @modules_connection, notice: 'Connection was successfully created.'
33
- else
34
- render :new
35
- end
36
- end
27
+ # POST
28
+ def create
29
+ @modules_connection = Modules::Connection.new(modules_connection_params)
37
30
 
38
- # PATCH/PUT /modules/connections/1
39
- def update
40
- if @modules_connection.update(modules_connection_params)
41
- redirect_to @modules_connection, notice: 'Connection was successfully updated.'
42
- else
43
- render :edit
44
- end
45
- end
31
+ if @modules_connection.save
32
+ redirect_to modules_connections_url, notice: 'Connection was successfully created.'
33
+ else
34
+ render :new
35
+ end
36
+ end
46
37
 
47
- # DELETE /modules/connections/1
48
- def destroy
49
- @modules_connection.destroy
50
- redirect_to modules_connections_url, notice: 'Connection was successfully destroyed.'
51
- end
38
+ # PATCH/PUT
39
+ def update
40
+ if @modules_connection.update(modules_connection_params)
41
+ redirect_to modules_connections_url, notice: 'Connection was successfully updated.'
42
+ else
43
+ render :edit
44
+ end
45
+ end
52
46
 
53
- private
54
- # Use callbacks to share common setup or constraints between actions.
55
- def set_modules_connection
56
- @modules_connection = Modules::Connection.find(params[:id])
57
- end
47
+ # DELETE
48
+ def destroy
49
+ @modules_connection.destroy
50
+ redirect_to modules_connections_url, notice: 'Connection was successfully destroyed.'
51
+ end
58
52
 
59
- # Only allow a trusted parameter "white list" through.
60
- def modules_connection_params
61
- params.fetch(:modules_connection, {})
62
- end
63
- end
53
+ private
54
+
55
+ # Common Callbacks
56
+ def set_modules_connection
57
+ @modules_connection = Modules::Connection.find(params[:id])
58
+ end
59
+
60
+ # Whitelist
61
+ def modules_connection_params
62
+ params.require(:modules_connection).permit(:post_id, :category_id)
63
+ end
64
+
65
+ end
64
66
  end
@@ -5,8 +5,8 @@ module Phcpresspro
5
5
  mount_uploader :pstimage, Phcpresspro::PstimageUploader
6
6
 
7
7
  # Relationships
8
- has_many :connections, class_name: 'Modules::Connection'
9
- has_many :categories, class_name: 'Modules::Category', :through => :connections
8
+ has_many :connections, class_name: 'Phcpresspro::Modules::Connection'
9
+ has_many :categories, class_name: 'Phcpresspro::Modules::Category', :through => :connections
10
10
 
11
11
  end
12
12
  end
@@ -2,8 +2,8 @@ module Phcpresspro
2
2
  class Modules::Category < ApplicationRecord
3
3
 
4
4
  # Relationships
5
- has_many :connections, class_name: 'Modules::Connection'
6
- has_many :posts, class_name: 'Modules::Category', :through => :connections
5
+ has_many :connections, class_name: 'Phcpresspro::Modules::Connection'
6
+ has_many :posts, class_name: 'Phcpresspro::Modules::Category', :through => :connections
7
7
 
8
8
  end
9
9
  end
@@ -2,8 +2,8 @@ module Phcpresspro
2
2
  class Modules::Connection < ApplicationRecord
3
3
 
4
4
  # Relationships
5
- belongs_to :post, class_name: 'Articles::Post'
6
- belongs_to :category, class_name: 'Modules::Category'
5
+ belongs_to :post, class_name: 'Phcpresspro::Articles::Post'
6
+ belongs_to :category, class_name: 'Phcpresspro::Modules::Category'
7
7
 
8
8
  end
9
9
  end
@@ -44,7 +44,7 @@
44
44
  </div>
45
45
  <div class="panel-body">
46
46
  <div class="form-group">
47
- <%= f.collection_check_boxes :category_ids, Modules::Category.all, :id, :catname do |post_category| %>
47
+ <%= f.collection_check_boxes :category_ids, Phcpresspro::Modules::Category.all, :id, :catname do |post_category| %>
48
48
  <%= post_category.check_box %>
49
49
  <%= post_category.label %></br>
50
50
  <% end %>
data/config/routes.rb CHANGED
@@ -2,13 +2,13 @@ Phcpresspro::Engine.routes.draw do
2
2
 
3
3
  # Article Routes
4
4
  namespace :articles do
5
- resources :posts, class_name: 'Articles::Post'
5
+ resources :posts, class_name: 'Phcpresspro::Articles::Post'
6
6
  end
7
7
 
8
8
  # Module Routes
9
9
  namespace :modules do
10
- resources :connections, class_name: 'Modules::Connection'
11
- resources :categories, class_name: 'Modules::Category'
10
+ resources :connections, class_name: 'Phcpresspro::Modules::Connection'
11
+ resources :categories, class_name: 'Phcpresspro::Modules::Category'
12
12
  end
13
13
 
14
14
  end
@@ -1,3 +1,3 @@
1
1
  module Phcpresspro
2
- VERSION = "4.1.8"
2
+ VERSION = "4.1.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phcpresspro
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.8
4
+ version: 4.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - BradPotts