rocket_cms 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/rocket_cms/version.rb +1 -1
- metadata +1 -2
- data/app/models/concerns/manual_slug.rb +0 -38
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7cd52bf675c271bdebedd19c6b90b9556a285a8
|
4
|
+
data.tar.gz: 4939e20e95c8cbebc16679af8a8a7efa092200df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b60a7cbbdab9670a8dbe3b9c93749a1bf2950eb86df42761c63d0c8c134236db2ee08805d2bc57be95a0425a82c67380a4db2df53c3de0394254268fd1bf8cb8
|
7
|
+
data.tar.gz: 432a375ea03d3dea9ec6569ef06f60ac50a2a711cdddf7ad5483ae9f7e040bc651b58015f86c74fdafb71d40d255fe2f78237b1b41c3c6a73a37686a2a818978
|
data/Gemfile.lock
CHANGED
data/lib/rocket_cms/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rocket_cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- glebtv
|
@@ -370,7 +370,6 @@ files:
|
|
370
370
|
- app/models/concerns/boolean_field.rb
|
371
371
|
- app/models/concerns/enableable.rb
|
372
372
|
- app/models/concerns/geocodeable.rb
|
373
|
-
- app/models/concerns/manual_slug.rb
|
374
373
|
- app/models/concerns/mappable.rb
|
375
374
|
- app/models/concerns/seoable.rb
|
376
375
|
- app/models/concerns/sort_field.rb
|
@@ -1,38 +0,0 @@
|
|
1
|
-
module ManualSlug
|
2
|
-
extend ActiveSupport::Concern
|
3
|
-
include Mongoid::Slug
|
4
|
-
|
5
|
-
def text_slug
|
6
|
-
self._slugs.empty? ? '' : self._slugs.last
|
7
|
-
end
|
8
|
-
def text_slug=(slug)
|
9
|
-
if slug.blank?
|
10
|
-
self._slugs = []
|
11
|
-
else
|
12
|
-
self._slugs.delete(slug)
|
13
|
-
self._slugs << slug
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
module ClassMethods
|
18
|
-
def manual_slug(field, options = {}, callback = true)
|
19
|
-
options.merge!(permanent: true, history: true)
|
20
|
-
slug field, options
|
21
|
-
|
22
|
-
# we will create slugs manually when needed
|
23
|
-
skip_callback :create, :before, :build_slug
|
24
|
-
|
25
|
-
before_validation do
|
26
|
-
self._slugs = self._slugs.map{ |s| s.strip }.select {|s| !s.blank? }
|
27
|
-
|
28
|
-
if self._slugs.empty?
|
29
|
-
self.build_slug
|
30
|
-
end
|
31
|
-
|
32
|
-
true
|
33
|
-
end if callback
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
end
|
38
|
-
|