puffer_pages 0.0.12 → 0.0.13
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.
- data/VERSION +1 -1
- data/app/models/page.rb +4 -7
- data/puffer_pages.gemspec +2 -2
- data/spec/models/page_spec.rb +2 -2
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.13
|
data/app/models/page.rb
CHANGED
@@ -31,20 +31,17 @@ class Page < ActiveRecord::Base
|
|
31
31
|
:message => :slug_format,
|
32
32
|
:unless => :root?
|
33
33
|
validates_format_of :slug,
|
34
|
-
:with =>
|
34
|
+
:with => nil,
|
35
35
|
:message => :root_slug_format,
|
36
36
|
:if => :root?
|
37
37
|
validates_inclusion_of :status, :in => Page.statuses
|
38
38
|
|
39
39
|
attr_protected :location
|
40
40
|
|
41
|
-
before_validation :
|
42
|
-
def
|
41
|
+
before_validation :default_values
|
42
|
+
def default_values
|
43
43
|
self.status ||= 'draft'
|
44
|
-
|
45
|
-
|
46
|
-
before_save :update_location
|
47
|
-
def update_location
|
44
|
+
self.slug = slug.presence
|
48
45
|
self.location = [swallow_nil{parent.location}, slug].compact.join('/').presence
|
49
46
|
end
|
50
47
|
|
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.13"
|
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-15}
|
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 = [
|
data/spec/models/page_spec.rb
CHANGED
@@ -15,8 +15,8 @@ describe Page do
|
|
15
15
|
@root = Fabricate :page, :layout_name => 'foo_layout'
|
16
16
|
end
|
17
17
|
|
18
|
-
it 'should have
|
19
|
-
@root.slug.should ==
|
18
|
+
it 'should have nil slug location if root' do
|
19
|
+
@root.slug.should == nil
|
20
20
|
@root.location.should == nil
|
21
21
|
end
|
22
22
|
|
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: 5
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 13
|
10
|
+
version: 0.0.13
|
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-15 00:00:00 +03:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|