tiny_cms 0.2.5 → 0.2.6

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.
Files changed (4) hide show
  1. data/Rakefile +2 -1
  2. data/VERSION +1 -1
  3. data/lib/tiny_cms/node.rb +3 -1
  4. metadata +21 -5
data/Rakefile CHANGED
@@ -10,8 +10,9 @@ begin
10
10
  gem.email = "macarui@gmail.com"
11
11
  gem.homepage = "http://github.com/maca/tiny_cms"
12
12
  gem.authors = ["Macario"]
13
- gem.add_development_dependency "shoulda", ">= 0"
13
+ gem.add_development_dependency "shoulda", ">= 2.11.1"
14
14
  gem.add_development_dependency "rails", ">= 2.3.5"
15
+ gem.add_development_dependency "factory_girl", ">= 1.3.1"
15
16
  end
16
17
  Jeweler::GemcutterTasks.new
17
18
  rescue LoadError
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.5
1
+ 0.2.6
data/lib/tiny_cms/node.rb CHANGED
@@ -33,6 +33,8 @@ module TinyCMS
33
33
  {:conditions => {:parent_id => parent_id}}
34
34
  }
35
35
 
36
+ model.named_scope :exclude_by_id, lambda { |id| {:conditions => "id != #{id}"} }
37
+
36
38
  model.belongs_to :parent, :class_name => model.to_s, :foreign_key => 'parent_id'
37
39
  model.has_many :children, :class_name => model.to_s, :foreign_key => 'parent_id', :order => 'position', :dependent => :destroy
38
40
 
@@ -67,7 +69,7 @@ module TinyCMS
67
69
  end
68
70
 
69
71
  def siblings
70
- section.find :all, :conditions => "id != #{id}"
72
+ section.exclude_by_id self.id
71
73
  end
72
74
 
73
75
  def section
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 5
9
- version: 0.2.5
8
+ - 6
9
+ version: 0.2.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - Macario
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-08-18 00:00:00 -05:00
17
+ date: 2010-09-08 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -25,8 +25,10 @@ dependencies:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  segments:
28
- - 0
29
- version: "0"
28
+ - 2
29
+ - 11
30
+ - 1
31
+ version: 2.11.1
30
32
  type: :development
31
33
  version_requirements: *id001
32
34
  - !ruby/object:Gem::Dependency
@@ -43,6 +45,20 @@ dependencies:
43
45
  version: 2.3.5
44
46
  type: :development
45
47
  version_requirements: *id002
48
+ - !ruby/object:Gem::Dependency
49
+ name: factory_girl
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ segments:
56
+ - 1
57
+ - 3
58
+ - 1
59
+ version: 1.3.1
60
+ type: :development
61
+ version_requirements: *id003
46
62
  description: |-
47
63
  Minimal CMS Rails Engine or more likelly a "static" pages manager.
48
64
  Pages can be created, deleted, edited and arranged into sections using a file tree like interface courtesy of jQuery tree (http://jstree.com).