phcpresspro 70.0.0 → 70.1.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
  SHA256:
3
- metadata.gz: 568a5f49b83362679e43aaadabc34f79fa54a165743cf464d7080f0ca5894d69
4
- data.tar.gz: 82c886ab0c714a0bc1a9890e8860c447587b0ea24f602a42d9b77ee67429b0c6
3
+ metadata.gz: d1167a233a14ffea6fc216b61d203b09800e8edd463b9da44a40dd6d9d5c05c5
4
+ data.tar.gz: 2fad5cc81aa8593e50e1ac50c7004eb8d67734bae2b2feb3b955b27f4b6f67e4
5
5
  SHA512:
6
- metadata.gz: c87e78eb8cfe8d8291be7fe4d8eac05fd32531f02d56f11085cdb02547061a9c38e7f6152118c324a32e850f9654f578526fd81c1f1fa46f7962b6fd7568d12d
7
- data.tar.gz: 68a7ec8af071cbaaa9e861f4edfbc9a0f0ad9077818e4a38eed93343c163c101d48026c424dae5570d0f2fa363a7a1ad2c1682f17dcd4ad6b9a7ad268e7be0ee
6
+ metadata.gz: 73c37442c4129048959a9dd994c72ded0ffb1195c86dd300f9afb7f491dc8ecef79e2f50df1d991256537f63551834dd9befb5a6b45cf353cfa9142bee6f1eb1
7
+ data.tar.gz: 73cae04d7989901261b94b2556c17746a6d2e9902a7b5be94d37b3dea0849c00640aea66763412f3a91ecdc13e44931ba80ab52197702d005a6df4765b7e697a
@@ -36,7 +36,6 @@ module Phcpresspro
36
36
  @article_post.user_id = current_user.id
37
37
  @article_post.org_id = current_user.org_id
38
38
  if @article_post.save
39
- @article_post.connections.build
40
39
  redirect_to article_posts_url, notice: 'Post was successfully created.'
41
40
  else
42
41
  render :new
@@ -48,7 +47,6 @@ module Phcpresspro
48
47
  @article_post.user_id = current_user.id
49
48
  @article_post.org_id = current_user.org_id
50
49
  if @article_post.update(article_post_params)
51
- @article_post.connections.build
52
50
  redirect_to article_posts_url, notice: 'Post was successfully updated.'
53
51
  else
54
52
  render :edit
@@ -8,11 +8,12 @@ module Phcpresspro
8
8
  has_paper_trail :class_name => 'Phcpresspro::CategoryVersions'
9
9
 
10
10
  # Relationships
11
- has_many :posts, class_name: 'Phcpresspro::Article::Post'
11
+ has_and_belongs_to_many :posts, class_name: 'Phcpresspro::Article::Post', :join_table => 'categories_posts'
12
12
 
13
13
  # Validation for Form Fields
14
14
  validates :catname,
15
15
  presence: true,
16
+ uniqueness: true,
16
17
  length: { minimum: 3 }
17
18
 
18
19
  # Clean URL Define
@@ -11,7 +11,7 @@ module Phcpresspro
11
11
  has_one_attached :pstimage
12
12
 
13
13
  # Model Relationships
14
- has_many :categories, class_name: 'Phcpresspro::Article::Category'
14
+ has_and_belongs_to_many :categories, class_name: 'Phcpresspro::Article::Category', :join_table => 'categories_posts'
15
15
 
16
16
  # Validation for Form Fields
17
17
  validates :psttittle,
@@ -1,4 +1,4 @@
1
- class CreatePhcpressproJoinTableCategoriesPosts < ActiveRecord::Migration[5.2]
1
+ class CreateJoinTableCategoriesPosts < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  create_join_table :categories, :posts do |t|
4
4
  # t.index [:category_id, :post_id]
@@ -1,3 +1,3 @@
1
1
  module Phcpresspro
2
- VERSION = "70.0.0"
2
+ VERSION = "70.1.0"
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: 70.0.0
4
+ version: 70.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - BradPotts
@@ -690,7 +690,7 @@ files:
690
690
  - db/migrate/20170517064427_create_phcpresspro_category_versions.rb
691
691
  - db/migrate/20190315010932_create_phcpresspro_article_posts.rb
692
692
  - db/migrate/20190315040834_create_phcpresspro_article_categories.rb
693
- - db/migrate/20190315173237_create_phcpresspro_join_table_categories_posts.rb
693
+ - db/migrate/20190315173237_create_join_table_categories_posts.rb
694
694
  - lib/phcpresspro.rb
695
695
  - lib/phcpresspro/engine.rb
696
696
  - lib/phcpresspro/version.rb