brightcontent-pages 2.1.1 → 2.1.2

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
  SHA1:
3
- metadata.gz: 112947762fa3d05aa45691987766348bd2256438
4
- data.tar.gz: 0c19ad6cf07c0dd1314e486edded47cf12b4981c
3
+ metadata.gz: f3eb606026af0b323c26dea10abaad65d5665fb4
4
+ data.tar.gz: cf5897ffcddb3febba4649e23892f53ca735446b
5
5
  SHA512:
6
- metadata.gz: 3ba829349ef0b518b96e53e1d84cc74fa6ba9892819794677873743f8417e8abb42333791206de2d0db60b382c73e76a05349370a781060665491ef94f224ffc
7
- data.tar.gz: d6730a095af90e99dae1763f3f4b50871dedd55141a5a76dae02dee4c6a10b15dca19ef1ce0d5766091b43b8964668eb30a557d9aa26b7b3a3bf16b1d25fe98a
6
+ metadata.gz: 703cfc2bff80577f28d6d1e72c554a5e7a7cf54d9087ad016aafb8439eccd433e8dc4400e8f8af2dede7761c754f32446f904c95170145571b87ed4e53c241ad
7
+ data.tar.gz: a5a8da50c63faa32e4dde8e0ff5b962d083d310d49c5760bf4963159ac523800e3d0d243591741ba44129b725c0502483b3efdd11dbb75039c775272a4a976e3
@@ -13,7 +13,11 @@ module Brightcontent
13
13
  end
14
14
 
15
15
  def sortable_model
16
- Brightcontent::Page
16
+ Brightcontent.page_model
17
+ end
18
+
19
+ def self.resource_class
20
+ Brightcontent.page_model
17
21
  end
18
22
 
19
23
  protected
@@ -1,7 +1,7 @@
1
1
  module Brightcontent
2
2
  module PagesHelper
3
3
  def page_selector(current_page)
4
- Page.all.map do |page|
4
+ Brightcontent.page_model.all.map do |page|
5
5
  ["#{page_prefix(page.depth)} #{page.name}", page.id] if page != current_page
6
6
  end.compact
7
7
  end
@@ -2,11 +2,11 @@ module Brightcontent
2
2
  module Pages
3
3
  module Methods
4
4
  def current_page
5
- @current_page ||= Page.find_by_path(request.path)
5
+ @current_page ||= Brightcontent.page_model.find_by_path(request.path)
6
6
  end
7
7
 
8
8
  def current_page!
9
- @current_page ||= Page.find_by_path!(request.path)
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 = Page.sanitize_path(request.path)
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
- Page.pluck(:slug)
22
+ Brightcontent.page_model.pluck(:slug)
23
23
  end
24
24
  end
25
25
  end
@@ -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.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-01 00:00:00.000000000 Z
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.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.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.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.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