noodall-core 0.5.6 → 0.5.7
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/lib/noodall/node.rb +11 -1
- data/noodall-core.gemspec +2 -2
- metadata +4 -4
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.
|
|
1
|
+
0.6.0
|
data/lib/noodall/node.rb
CHANGED
|
@@ -23,6 +23,7 @@ module Noodall
|
|
|
23
23
|
key :publishable_groups, Array
|
|
24
24
|
key :viewable_groups, Array
|
|
25
25
|
key :permalink, Permalink, :required => true, :index => true
|
|
26
|
+
key :admin_title, String
|
|
26
27
|
|
|
27
28
|
timestamps!
|
|
28
29
|
userstamps!
|
|
@@ -155,9 +156,18 @@ module Noodall
|
|
|
155
156
|
def slug
|
|
156
157
|
(self.name.blank? ? self.title : self.name).to_s.parameterize
|
|
157
158
|
end
|
|
159
|
+
|
|
160
|
+
def admin_title
|
|
161
|
+
title
|
|
162
|
+
end
|
|
158
163
|
|
|
159
164
|
private
|
|
160
165
|
|
|
166
|
+
before_save :set_admin_title
|
|
167
|
+
def set_admin_title
|
|
168
|
+
self.admin_title = admin_title
|
|
169
|
+
end
|
|
170
|
+
|
|
161
171
|
def switch_position(sibling)
|
|
162
172
|
tmp = sibling.position
|
|
163
173
|
sibling.position = self.position
|
|
@@ -266,7 +276,7 @@ module Noodall
|
|
|
266
276
|
after_destroy :order_previous_siblings
|
|
267
277
|
def order_previous_siblings
|
|
268
278
|
unless previous_parent_id.nil?
|
|
269
|
-
search_class.where(parent_id_field => previous_parent_id).each_with_index do |sibling, index|
|
|
279
|
+
search_class.where(parent_id_field => previous_parent_id).order(tree_order).each_with_index do |sibling, index|
|
|
270
280
|
unless sibling.position == index
|
|
271
281
|
sibling.position = index
|
|
272
282
|
search_class.collection.save(sibling.to_mongo, :safe => true)
|
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.5.
|
|
8
|
+
s.version = "0.5.7"
|
|
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{2011-02
|
|
12
|
+
s.date = %q{2011-03-02}
|
|
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 = [
|
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:
|
|
4
|
+
hash: 5
|
|
5
5
|
prerelease:
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 5
|
|
9
|
-
-
|
|
10
|
-
version: 0.5.
|
|
9
|
+
- 7
|
|
10
|
+
version: 0.5.7
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Steve England
|
|
@@ -15,7 +15,7 @@ autorequire:
|
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
17
|
|
|
18
|
-
date: 2011-02
|
|
18
|
+
date: 2011-03-02 00:00:00 +00:00
|
|
19
19
|
default_executable:
|
|
20
20
|
dependencies:
|
|
21
21
|
- !ruby/object:Gem::Dependency
|