acts_as_sortable 0.0.0.pre1 → 0.0.0.pre2
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/acts_as_sortable.gemspec +54 -0
- data/lib/acts_as_sortable.rb +4 -4
- metadata +2 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.0.
|
1
|
+
0.0.0.pre2
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{acts_as_sortable}
|
8
|
+
s.version = "0.0.0.pre2"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["jduarte"]
|
12
|
+
s.date = %q{2010-03-06}
|
13
|
+
s.description = %q{Easy way to make sortable models in ActiveRecord}
|
14
|
+
s.email = %q{jose.fduarte@gmail.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".gitignore",
|
22
|
+
"LICENSE",
|
23
|
+
"README.rdoc",
|
24
|
+
"Rakefile",
|
25
|
+
"VERSION",
|
26
|
+
"acts_as_sortable.gemspec",
|
27
|
+
"lib/acts_as_sortable.rb",
|
28
|
+
"test/helper.rb",
|
29
|
+
"test/test_acts_as_sortable.rb"
|
30
|
+
]
|
31
|
+
s.homepage = %q{http://github.com/jduarte/acts_as_sortable}
|
32
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
33
|
+
s.require_paths = ["lib"]
|
34
|
+
s.rubygems_version = %q{1.3.5}
|
35
|
+
s.summary = %q{Easy way to make sortable models in ActiveRecord}
|
36
|
+
s.test_files = [
|
37
|
+
"test/helper.rb",
|
38
|
+
"test/test_acts_as_sortable.rb"
|
39
|
+
]
|
40
|
+
|
41
|
+
if s.respond_to? :specification_version then
|
42
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
43
|
+
s.specification_version = 3
|
44
|
+
|
45
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
46
|
+
s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
47
|
+
else
|
48
|
+
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
49
|
+
end
|
50
|
+
else
|
51
|
+
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
data/lib/acts_as_sortable.rb
CHANGED
@@ -65,8 +65,8 @@ module ActsAsSortable
|
|
65
65
|
ActiveRecord::Base.transaction do
|
66
66
|
previous_sequence , self_sequence = prev_elem.send(column) , self.send(column)
|
67
67
|
prev_elem.send(column.to_s.concat("=").to_sym, -1) # Temp only
|
68
|
-
self.send(column.to_s.concat("=").to_sym
|
69
|
-
prev_elem.send(column.to_s.concat("=").to_sym
|
68
|
+
self.send(column.to_s.concat("=").to_sym, previous_sequence) # Ups self
|
69
|
+
prev_elem.send(column.to_s.concat("=").to_sym, self_sequence) # Downs the Previous Element
|
70
70
|
prev_elem.save!
|
71
71
|
self.save!
|
72
72
|
end
|
@@ -84,8 +84,8 @@ module ActsAsSortable
|
|
84
84
|
ActiveRecord::Base.transaction do
|
85
85
|
next_sequence , self_sequence = next_elem.send(column) , self.send(column)
|
86
86
|
next_elem.send(column.to_s.concat("=").to_sym, -1) # Temp only
|
87
|
-
self.send(column.to_s.concat("=").to_sym
|
88
|
-
next_elem.send(column.to_s.concat("=").to_sym
|
87
|
+
self.send(column.to_s.concat("=").to_sym, next_sequence) # Downs self
|
88
|
+
next_elem.send(column.to_s.concat("=").to_sym, self_sequence) # Ups The Next Element
|
89
89
|
next_elem.save!
|
90
90
|
self.save!
|
91
91
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_sortable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.0.
|
4
|
+
version: 0.0.0.pre2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jduarte
|
@@ -38,6 +38,7 @@ files:
|
|
38
38
|
- README.rdoc
|
39
39
|
- Rakefile
|
40
40
|
- VERSION
|
41
|
+
- acts_as_sortable.gemspec
|
41
42
|
- lib/acts_as_sortable.rb
|
42
43
|
- test/helper.rb
|
43
44
|
- test/test_acts_as_sortable.rb
|