phcpresspro 4.0.4 → 4.0.5

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: 96567e94bc8fbc00830f3d49dc52777c77aa9b07
4
- data.tar.gz: d5451aa9c5cd461e616bee53ea2761ae73cf5c3f
3
+ metadata.gz: 2502868a47ca5fa52e7c060d59789d30a20019db
4
+ data.tar.gz: e15f698cb7ee695a4282050019a25f04dc41096b
5
5
  SHA512:
6
- metadata.gz: c259b712406a5bfc066859ef7e1107657b50ecef1bce15a7e1b264dba13ee5b0f94b57032f4dfea8b2b9e7a237b138434e0b4da95f0e0b1753faeedb24ca1721
7
- data.tar.gz: 67c6c67d8a943986f9abe47aea2f60bc6e3394f156e0f7401b9c1131e545569ec5db89089e062b13bd723e20a161a27096bdbe72d695cb0f284425ea8a68df77
6
+ metadata.gz: c4a2d5bc5a837211226a89c0b877a57169c1a665d155a696542b9dae8ac9f06c75b400586ef0c70a35f62ac43ebbdecfa77db09f81f066618cdfa75dc84cde09
7
+ data.tar.gz: 53d87d9986e85a683ee300193833b928841a0f17c2a0330f6f0864cd791069a17d53cede2c4d23523654f271685f955a458df06c6df12cd016647f7b00497ceb
@@ -5,7 +5,9 @@ module Phcpresspro
5
5
  mount_uploader :pstimage, Phcpresspro::PstimageUploader
6
6
 
7
7
  # Relationships
8
- has_many :categories, class_name: 'Modules::Category'
8
+ # Relationships
9
+ has_many :connections
10
+ has_many :categories, :through => :connections, class_name: 'Modules::Category'
9
11
 
10
12
  end
11
13
  end
@@ -2,7 +2,8 @@ module Phcpresspro
2
2
  class Modules::Category < ApplicationRecord
3
3
 
4
4
  # Relationships
5
- belongs_to :post, class_name: 'Articles::Post'
5
+ has_many :connections
6
+ has_many :posts, :through => :connections, class_name: 'Articles::Post'
6
7
 
7
8
  end
8
9
  end
@@ -0,0 +1,4 @@
1
+ module Phcpresspro
2
+ class Modules::Connection < ApplicationRecord
3
+ end
4
+ end
@@ -16,8 +16,10 @@
16
16
  <%= f.select( :pststatus, [['Draft','draft'],['Publish','publish'],['Review','review']], {}, {class: "form-control form-control-sm"}) %>
17
17
  </div>
18
18
  <div class="form-group">
19
- <%= f.label :pstcategory, "Post Category" %>
20
- <%= collection_select(:pstcategory, :category_id, Phcpresspro::Modules::Category.order('catname'), :id, :catname, {}, {class: "form-control form-control"}) %>
19
+ <%= f.fields_for :connection do |modules_connection| %>
20
+ <%= modules_connection.label :category_id, "Post Category" %>
21
+ <%= collection_select(:category_id, :category_id, Phcpresspro::Modules::Category.order('catname'), :id, :catname, {}, {class: "form-control form-control"}) %>
22
+ <% end %>
21
23
  </div>
22
24
  <div class="actions">
23
25
  <%= f.submit "Publish", class: "btn btn-primary btn-sm" %>
@@ -8,8 +8,6 @@ class CreatePhcpressproArticlesPosts < ActiveRecord::Migration[5.0]
8
8
  t.text :pstexcerpts
9
9
  t.string :pstimage
10
10
 
11
- t.references :category, index: true
12
-
13
11
  t.string :user_id
14
12
  t.string :membership_id
15
13
  t.string :oganization_id
@@ -0,0 +1,15 @@
1
+ class CreatePhcpressproModulesConnections < ActiveRecord::Migration[5.0]
2
+ def change
3
+ create_table :phcpresspro_modules_connections do |t|
4
+
5
+ # Article
6
+ t.references :post, index: true
7
+
8
+ # Modules
9
+ t.references :category, index: true
10
+
11
+ t.timestamps
12
+
13
+ end
14
+ end
15
+ end
@@ -1,3 +1,3 @@
1
1
  module Phcpresspro
2
- VERSION = "4.0.4"
2
+ VERSION = "4.0.5"
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.0.4
4
+ version: 4.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - BradPotts
@@ -547,6 +547,7 @@ files:
547
547
  - app/models/phcpresspro/articles/post.rb
548
548
  - app/models/phcpresspro/modules.rb
549
549
  - app/models/phcpresspro/modules/category.rb
550
+ - app/models/phcpresspro/modules/connection.rb
550
551
  - app/uploaders/phcpresspro/pstimage_uploader.rb
551
552
  - app/views/layouts/phcpresspro/application.html.erb
552
553
  - app/views/layouts/phcpresspro/backend/blog_layout.html.erb
@@ -563,6 +564,7 @@ files:
563
564
  - config/routes.rb
564
565
  - db/migrate/20160716182936_create_phcpresspro_modules_categories.rb
565
566
  - db/migrate/20160718204718_create_phcpresspro_articles_posts.rb
567
+ - db/migrate/20160719194145_create_phcpresspro_modules_connections.rb
566
568
  - lib/phcpresspro.rb
567
569
  - lib/phcpresspro/engine.rb
568
570
  - lib/phcpresspro/version.rb