camaleon_cms 2.4.5.14 → 2.4.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of camaleon_cms might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/controllers/camaleon_cms/admin_controller.rb +5 -5
- data/app/models/camaleon_cms/post.rb +1 -2
- data/lib/camaleon_cms/engine.rb +1 -1
- data/lib/camaleon_cms/version.rb +1 -1
- data/lib/plugin_routes.rb +10 -5
- metadata +14 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edf7d17c2ecab36f403abf53b59be1137d30ba0c43f5a42e7be0f1c2daa72107
|
4
|
+
data.tar.gz: 4657f09eda8fad47aa818b5ce2f280b38cd8af275b422d0e1f24b2c022dfb694
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90daa373bc76c095d1a000860e9107cb5d093283d8395af7af567564b9d1687f6ee6460837a5253946db5eba35b1648012305eaee19ff4698f7cadfaa7d2b536
|
7
|
+
data.tar.gz: 7afd87501344e6c1d27f9d715b6ad10daa53047d60f000b98cec9e389581a2000e73f6c0ed422e8fb6742bd5a40d3bd4949797f1b1bfa91a4485cc1995849d11
|
@@ -43,15 +43,15 @@ class CamaleonCms::AdminController < CamaleonCms::CamaleonController
|
|
43
43
|
add_breadcrumb I18n.t("camaleon_cms.admin.button.search")
|
44
44
|
params[:kind] = "content" unless params[:kind].present?
|
45
45
|
params[:q] = (params[:q] || '').downcase
|
46
|
-
case params[:kind]
|
46
|
+
@items = case params[:kind]
|
47
47
|
when "post_type"
|
48
|
-
|
48
|
+
current_site.post_types.where("LOWER(#{Cama::PostType.table_name}.name) LIKE ? OR LOWER(#{Cama::PostType.table_name}.slug) LIKE ? OR LOWER(#{Cama::PostType.table_name}.description) LIKE ?", "%#{params[:q]}%", "%#{params[:q]}%", "%#{params[:q]}%")
|
49
49
|
when "category"
|
50
|
-
|
50
|
+
current_site.full_categories.where("LOWER(#{Cama::Category.table_name}.name) LIKE ? OR LOWER(#{Cama::Category.table_name}.slug) LIKE ? OR LOWER(#{Cama::Category.table_name}.description) LIKE ?", "%#{params[:q]}%", "%#{params[:q]}%", "%#{params[:q]}%")
|
51
51
|
when "tag"
|
52
|
-
|
52
|
+
current_site.post_tags.where("LOWER(#{Cama::PostTag.table_name}.name) LIKE ? OR LOWER(#{Cama::PostTag.table_name}.slug) LIKE ? OR LOWER(#{Cama::PostTag.table_name}.description) LIKE ?", "%#{params[:q]}%", "%#{params[:q]}%", "%#{params[:q]}%")
|
53
53
|
else
|
54
|
-
|
54
|
+
current_site.posts.where("LOWER(#{Cama::Post.table_name}.title) LIKE ? OR LOWER(#{Cama::Post.table_name}.slug) LIKE ? OR LOWER(#{Cama::Post.table_name}.content_filtered) LIKE ?", "%#{params[:q]}%", "%#{params[:q]}%", "%#{params[:q]}%")
|
55
55
|
end
|
56
56
|
@items = @items.paginate(:page => params[:page], :per_page => current_site.admin_per_page)
|
57
57
|
end
|
@@ -6,8 +6,7 @@ class CamaleonCms::PostUniqValidator < ActiveModel::Validator
|
|
6
6
|
if ptype.present? # only for posts that belongs to a post type model
|
7
7
|
posts = ptype.site.posts
|
8
8
|
.where("(#{slug_array.map {|s| "#{CamaleonCms::Post.table_name}.slug LIKE '%-->#{s}<!--%'"}.join(" OR ")} ) OR #{CamaleonCms::Post.table_name}.slug = ?", record.slug)
|
9
|
-
.where(
|
10
|
-
.where.not(id: record.id)
|
9
|
+
.where.not(id: record.id, status: [:draft, :draft_child, :trash])
|
11
10
|
if posts.size > 0
|
12
11
|
if slug_array.size > 1
|
13
12
|
record.errors[:base] << "#{I18n.t('camaleon_cms.admin.post.message.requires_different_slug')}: #{posts.pluck(:slug).map{|slug| record.slug.to_s.translations.map{|lng, r_slug| "#{r_slug} (#{lng})" if slug.translations_array.include?(r_slug) }.join(",") }.join(",").split(",").uniq.clean_empty.join(", ")} "
|
data/lib/camaleon_cms/engine.rb
CHANGED
@@ -27,7 +27,7 @@ module CamaleonCms
|
|
27
27
|
g.test_framework :rspec
|
28
28
|
end
|
29
29
|
config.before_initialize do |app|
|
30
|
-
app.config.active_record.belongs_to_required_by_default = false if PluginRoutes.isRails5?
|
30
|
+
app.config.active_record.belongs_to_required_by_default = false if PluginRoutes.isRails5? || PluginRoutes.isRails6?
|
31
31
|
if app.respond_to?(:console)
|
32
32
|
app.console do
|
33
33
|
# puts "******** Camaleon CMS: ********"
|
data/lib/camaleon_cms/version.rb
CHANGED
data/lib/plugin_routes.rb
CHANGED
@@ -105,11 +105,16 @@ class PluginRoutes
|
|
105
105
|
def isRails5?
|
106
106
|
Rails.version.to_s[0].to_i == 5
|
107
107
|
end
|
108
|
+
|
109
|
+
def isRails6?
|
110
|
+
Rails.version.to_s[0].to_i == 6
|
111
|
+
end
|
112
|
+
|
108
113
|
# convert action parameter into hash
|
109
114
|
def fixActionParameter(h)
|
110
115
|
(h.is_a?(ActionController::Parameters) ? (h.permit!.to_h rescue h.to_hash) : h)
|
111
116
|
end
|
112
|
-
|
117
|
+
|
113
118
|
# add a new anonymous hook
|
114
119
|
# sample: PluginRoutes.add_anonymous_hook('before_admin', lambda{|params| puts params })
|
115
120
|
# @param hook_key [String], key of hook
|
@@ -127,7 +132,7 @@ class PluginRoutes
|
|
127
132
|
def get_anonymous_hooks(hook_key)
|
128
133
|
(@@anonymous_hooks[hook_key.to_s] || []).map{|item| item[:callback] }
|
129
134
|
end
|
130
|
-
|
135
|
+
|
131
136
|
# return all registered anonymous hooks for hook_key
|
132
137
|
# @param hook_key [String] name of the hook
|
133
138
|
# @param hook_id [String] identifier of the anonymous hooks
|
@@ -135,7 +140,7 @@ class PluginRoutes
|
|
135
140
|
def remove_anonymous_hook(hook_key, hook_id)
|
136
141
|
(@@anonymous_hooks[hook_key.to_s] || []).delete_if{|item| item[:id] == hook_id }
|
137
142
|
end
|
138
|
-
|
143
|
+
|
139
144
|
# return the class name for user model
|
140
145
|
def get_user_class_name
|
141
146
|
static_system_info['user_model'].presence || 'CamaleonCms::User'
|
@@ -394,12 +399,12 @@ class PluginRoutes
|
|
394
399
|
rescue
|
395
400
|
Gem.available?(name)
|
396
401
|
end
|
397
|
-
|
402
|
+
|
398
403
|
# return the default url options for Camaleon CMS
|
399
404
|
def self.default_url_options
|
400
405
|
{host: (CamaleonCms::Site.main_site.slug rescue "")}
|
401
406
|
end
|
402
|
-
|
407
|
+
|
403
408
|
def self.migration_class
|
404
409
|
isRails4? ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
|
405
410
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: camaleon_cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Owen Peredo Diaz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bcrypt
|
@@ -28,16 +28,22 @@ dependencies:
|
|
28
28
|
name: cancancan
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '2.0'
|
34
|
+
- - "<"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '4'
|
34
37
|
type: :runtime
|
35
38
|
prerelease: false
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
37
40
|
requirements:
|
38
|
-
- - "
|
41
|
+
- - ">="
|
39
42
|
- !ruby/object:Gem::Version
|
40
43
|
version: '2.0'
|
44
|
+
- - "<"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '4'
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
48
|
name: draper
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -196,16 +202,16 @@ dependencies:
|
|
196
202
|
name: cama_contact_form
|
197
203
|
requirement: !ruby/object:Gem::Requirement
|
198
204
|
requirements:
|
199
|
-
- - "
|
205
|
+
- - ">="
|
200
206
|
- !ruby/object:Gem::Version
|
201
|
-
version: 0.0.
|
207
|
+
version: 0.0.28
|
202
208
|
type: :runtime
|
203
209
|
prerelease: false
|
204
210
|
version_requirements: !ruby/object:Gem::Requirement
|
205
211
|
requirements:
|
206
|
-
- - "
|
212
|
+
- - ">="
|
207
213
|
- !ruby/object:Gem::Version
|
208
|
-
version: 0.0.
|
214
|
+
version: 0.0.28
|
209
215
|
- !ruby/object:Gem::Dependency
|
210
216
|
name: cama_meta_tag
|
211
217
|
requirement: !ruby/object:Gem::Requirement
|