camaleon_cms 2.4.4.1 → 2.4.4.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of camaleon_cms might be problematic. Click here for more details.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc3e07537e67c571eec9b63db5f09708ea5b3e8e
|
4
|
+
data.tar.gz: 5128328e45dfa810ea9a76a02a1ad44dcfe6d17e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1bd02ae23bc5504c68e805fad7940daf4bf1a7e5d255e01d0bcbe9014061ca72a334b5ebfca376bcdefe03c649558c6cdb431bd9652004e80dad3f2b5761790
|
7
|
+
data.tar.gz: fd4bee1b01b82101170336f7c96289205f7a6addbf8f3309185c7f6e2cd49543866a15fc3431f1eecf08ca248c933a9b20c9ea1c7c3b534f2a6db3ddc81aa9c7
|
@@ -43,12 +43,12 @@ module CamaleonCms::CategoriesTagsForPosts extend ActiveSupport::Concern
|
|
43
43
|
def update_tags(tags)
|
44
44
|
rescue_extra_data
|
45
45
|
tags = tags.split(",").strip
|
46
|
-
post_tags =
|
47
|
-
post_tags = post_tags.where(
|
48
|
-
|
46
|
+
post_tags = post_type.post_tags
|
47
|
+
post_tags = post_tags.where.not(name: tags) if tags.present?
|
48
|
+
term_relationships.where("term_taxonomy_id in (?)", post_tags.pluck("#{CamaleonCms::TermTaxonomy.table_name}.id")).destroy_all
|
49
49
|
tags.each do |f|
|
50
|
-
post_tag =
|
51
|
-
|
50
|
+
post_tag = post_type.post_tags.where({name: f}).first_or_create(slug: f.parameterize)
|
51
|
+
term_relationships.where({term_taxonomy_id: post_tag.id}).first_or_create
|
52
52
|
end
|
53
53
|
update_counters("tags")
|
54
54
|
end
|
data/lib/camaleon_cms/version.rb
CHANGED