noodall-core 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- activesupport (3.0.1)
5
- bson (1.1.1)
6
- bson_ext (1.1.1)
4
+ activesupport (3.0.3)
5
+ bson (1.1.2)
6
+ bson_ext (1.1.2)
7
7
  canable (0.1.1)
8
8
  database_cleaner (0.5.2)
9
9
  diff-lcs (1.1.2)
@@ -21,7 +21,7 @@ GEM
21
21
  json_pure (1.4.6)
22
22
  mm-multi-parameter-attributes (0.1.1)
23
23
  mongo_mapper
24
- mongo (1.1.1)
24
+ mongo (1.1.2)
25
25
  bson (>= 1.1.1)
26
26
  mongo_mapper (0.8.6)
27
27
  activesupport (>= 2.3.4)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.2
1
+ 0.3.3
data/lib/noodall/node.rb CHANGED
@@ -8,7 +8,7 @@ module Noodall
8
8
  plugin Indexer
9
9
  plugin Search
10
10
  plugin Tagging
11
- plugin GlobalUpdateTime
11
+ plugin Noodall::GlobalUpdateTime
12
12
 
13
13
  key :title, String, :required => true
14
14
  key :name, String
@@ -169,7 +169,15 @@ module Noodall
169
169
 
170
170
  before_validation :set_permalink
171
171
  def set_permalink
172
- self.permalink = Permalink.new(*(ancestors << self).map{ |a| a.title.parameterize }) if permalink.blank? and not title.blank?
172
+ if permalink.blank?
173
+ # inherit the parents permalink and append the current node's .name or .title attribute
174
+ # this code takes name over title for the current node's slug
175
+ # this way enables children to inherit the parent's custom (user defined) permalink also
176
+ permalink_args = self.parent.permalink unless self.parent.nil?
177
+ self_slug = (self.name.blank? ? self.title : self.name).parameterize
178
+ permalink_args << self_slug unless self_slug.blank?
179
+ self.permalink = Permalink.new(*permalink_args)
180
+ end
173
181
  end
174
182
 
175
183
  before_save :set_position
data/noodall-core.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{noodall-core}
8
- s.version = "0.3.2"
8
+ s.version = "0.3.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Steve England"]
12
- s.date = %q{2010-11-03}
12
+ s.date = %q{2010-11-24}
13
13
  s.description = %q{Core data objects for Noodall}
14
14
  s.email = %q{steve@wearebeef.co.uk}
15
15
  s.extra_rdoc_files = [
@@ -47,10 +47,10 @@ Gem::Specification.new do |s|
47
47
  s.summary = %q{Core data objects for Noodall}
48
48
  s.test_files = [
49
49
  "spec/component_spec.rb",
50
- "spec/factories/component.rb",
51
- "spec/factories/node.rb",
50
+ "spec/spec_helper.rb",
52
51
  "spec/node_spec.rb",
53
- "spec/spec_helper.rb"
52
+ "spec/factories/component.rb",
53
+ "spec/factories/node.rb"
54
54
  ]
55
55
 
56
56
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: noodall-core
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 2
10
- version: 0.3.2
9
+ - 3
10
+ version: 0.3.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Steve England
@@ -15,11 +15,10 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-03 00:00:00 +00:00
18
+ date: 2010-11-24 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
- type: :runtime
23
22
  prerelease: false
24
23
  name: mongo_mapper
25
24
  version_requirements: &id001 !ruby/object:Gem::Requirement
@@ -34,8 +33,8 @@ dependencies:
34
33
  - 6
35
34
  version: 0.8.6
36
35
  requirement: *id001
37
- - !ruby/object:Gem::Dependency
38
36
  type: :runtime
37
+ - !ruby/object:Gem::Dependency
39
38
  prerelease: false
40
39
  name: ramdiv-mongo_mapper_acts_as_tree
41
40
  version_requirements: &id002 !ruby/object:Gem::Requirement
@@ -50,8 +49,8 @@ dependencies:
50
49
  - 1
51
50
  version: 0.1.1
52
51
  requirement: *id002
53
- - !ruby/object:Gem::Dependency
54
52
  type: :runtime
53
+ - !ruby/object:Gem::Dependency
55
54
  prerelease: false
56
55
  name: mm-multi-parameter-attributes
57
56
  version_requirements: &id003 !ruby/object:Gem::Requirement
@@ -66,8 +65,8 @@ dependencies:
66
65
  - 1
67
66
  version: 0.1.1
68
67
  requirement: *id003
69
- - !ruby/object:Gem::Dependency
70
68
  type: :runtime
69
+ - !ruby/object:Gem::Dependency
71
70
  prerelease: false
72
71
  name: canable
73
72
  version_requirements: &id004 !ruby/object:Gem::Requirement
@@ -82,8 +81,8 @@ dependencies:
82
81
  - 1
83
82
  version: 0.1.1
84
83
  requirement: *id004
85
- - !ruby/object:Gem::Dependency
86
84
  type: :runtime
85
+ - !ruby/object:Gem::Dependency
87
86
  prerelease: false
88
87
  name: ruby-stemmer
89
88
  version_requirements: &id005 !ruby/object:Gem::Requirement
@@ -96,6 +95,7 @@ dependencies:
96
95
  - 0
97
96
  version: "0"
98
97
  requirement: *id005
98
+ type: :runtime
99
99
  description: Core data objects for Noodall
100
100
  email: steve@wearebeef.co.uk
101
101
  executables: []
@@ -164,7 +164,7 @@ specification_version: 3
164
164
  summary: Core data objects for Noodall
165
165
  test_files:
166
166
  - spec/component_spec.rb
167
+ - spec/spec_helper.rb
168
+ - spec/node_spec.rb
167
169
  - spec/factories/component.rb
168
170
  - spec/factories/node.rb
169
- - spec/node_spec.rb
170
- - spec/spec_helper.rb