brightcontent-pages 2.1.1 → 2.1.2
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3eb606026af0b323c26dea10abaad65d5665fb4
|
4
|
+
data.tar.gz: cf5897ffcddb3febba4649e23892f53ca735446b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 703cfc2bff80577f28d6d1e72c554a5e7a7cf54d9087ad016aafb8439eccd433e8dc4400e8f8af2dede7761c754f32446f904c95170145571b87ed4e53c241ad
|
7
|
+
data.tar.gz: a5a8da50c63faa32e4dde8e0ff5b962d083d310d49c5760bf4963159ac523800e3d0d243591741ba44129b725c0502483b3efdd11dbb75039c775272a4a976e3
|
@@ -2,11 +2,11 @@ module Brightcontent
|
|
2
2
|
module Pages
|
3
3
|
module Methods
|
4
4
|
def current_page
|
5
|
-
@current_page ||=
|
5
|
+
@current_page ||= Brightcontent.page_model.find_by_path(request.path)
|
6
6
|
end
|
7
7
|
|
8
8
|
def current_page!
|
9
|
-
@current_page ||=
|
9
|
+
@current_page ||= Brightcontent.page_model.find_by_path!(request.path)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -8,7 +8,7 @@ module Brightcontent
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def matches?(request)
|
11
|
-
slug =
|
11
|
+
slug = Brightcontent.page_model.sanitize_path(request.path)
|
12
12
|
cached_page_slugs.include?(slug)
|
13
13
|
end
|
14
14
|
|
@@ -19,7 +19,7 @@ module Brightcontent
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def page_slugs
|
22
|
-
|
22
|
+
Brightcontent.page_model.pluck(:slug)
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
data/lib/brightcontent/pages.rb
CHANGED
@@ -13,6 +13,12 @@ module Brightcontent
|
|
13
13
|
mattr_accessor :page_attachment_styles
|
14
14
|
@@page_attachment_styles = {}
|
15
15
|
|
16
|
+
mattr_writer :page_model
|
17
|
+
def self.page_model
|
18
|
+
@@page_model.is_a?(String) ? @@page_model.constantize : @@page_model
|
19
|
+
end
|
20
|
+
@@page_model = "Brightcontent::Page"
|
21
|
+
|
16
22
|
module Pages
|
17
23
|
autoload :Methods, 'brightcontent/pages/methods'
|
18
24
|
autoload :PathConstraint, 'brightcontent/pages/path_constraint'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: brightcontent-pages
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Developers at Brightin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: brightcontent-core
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.1.
|
19
|
+
version: 2.1.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.1.
|
26
|
+
version: 2.1.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: brightcontent-attachments
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.1.
|
33
|
+
version: 2.1.2
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 2.1.
|
40
|
+
version: 2.1.2
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: awesome_nested_set
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|