puffer_pages 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/app/models/page.rb +1 -8
- data/lib/puffer_pages/liquid/file_system.rb +2 -2
- data/puffer_pages.gemspec +2 -2
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.11
|
data/app/models/page.rb
CHANGED
@@ -95,14 +95,7 @@ class Page < ActiveRecord::Base
|
|
95
95
|
end
|
96
96
|
|
97
97
|
def inherited_page_parts
|
98
|
-
scope = PagePart.where(:page_id => self_and_ancestors.map(&:id).
|
99
|
-
case PagePart.connection.adapter_name.downcase
|
100
|
-
when 'postgresql' then
|
101
|
-
ids = scope.select('distinct on (page_parts.name) page_parts.id').joins(:page).order('page_parts.name, pages.lft desc').map(&:id)
|
102
|
-
PagePart.where(:id => ids).order("name = '#{PufferPages.primary_page_part_name}' desc, name")
|
103
|
-
else
|
104
|
-
scope.group('name').order("name = '#{PufferPages.primary_page_part_name}' desc, name")
|
105
|
-
end
|
98
|
+
scope = PagePart.where(:page_parts => {:page_id => self_and_ancestors.map(&:id)}).joins(:page).order("page_parts.name = '#{PufferPages.primary_page_part_name}' desc, page_parts.name, pages.lft desc").uniq_by &:name
|
106
99
|
end
|
107
100
|
|
108
101
|
def part name
|
@@ -9,11 +9,11 @@ module PufferPages
|
|
9
9
|
when :snippet then
|
10
10
|
template_path = template_path.gsub(/^snippets\//, '')
|
11
11
|
snippet = Snippet.find_by_name(template_path)
|
12
|
-
raise FileSystemError, "No such snippet '#{template_path}' found" unless snippet
|
12
|
+
raise ::Liquid::FileSystemError, "No such snippet '#{template_path}' found" unless snippet
|
13
13
|
snippet.body
|
14
14
|
when :page_part then
|
15
15
|
page_part = context.registers[:page].part(template_path)
|
16
|
-
raise FileSystemError, "No such page_part '#{template_path}' found for current page" unless page_part
|
16
|
+
raise ::Liquid::FileSystemError, "No such page_part '#{template_path}' found for current page" unless page_part
|
17
17
|
page_part.body
|
18
18
|
end
|
19
19
|
end
|
data/puffer_pages.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{puffer_pages}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.11"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["pyromaniac"]
|
12
|
-
s.date = %q{2011-02-
|
12
|
+
s.date = %q{2011-02-14}
|
13
13
|
s.description = %q{Puffer pages is integratable rails CMS with puffer admin interface}
|
14
14
|
s.email = %q{kinwizard@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puffer_pages
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 11
|
10
|
+
version: 0.0.11
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- pyromaniac
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-02-
|
18
|
+
date: 2011-02-14 00:00:00 +03:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|