couchdb_acts_as_list 0.0.1.2 → 0.0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +4 -0
- data/lib/couchdb_acts_as_list/version.rb +1 -1
- data/lib/couchdb_acts_as_list.rb +2 -2
- metadata +3 -3
data/README.md
CHANGED
data/lib/couchdb_acts_as_list.rb
CHANGED
@@ -13,7 +13,7 @@ module CouchdbActsAsList
|
|
13
13
|
|
14
14
|
|
15
15
|
def insert_at pos
|
16
|
-
pos = [[pos.to_i,
|
16
|
+
pos = [[pos.to_i, self.class.count].min, 1].max
|
17
17
|
decrement_positions_on_lower_items self.position
|
18
18
|
self.update_attributes position: nil
|
19
19
|
increment_positions_on_lower_items pos
|
@@ -22,7 +22,7 @@ module CouchdbActsAsList
|
|
22
22
|
|
23
23
|
private
|
24
24
|
def set_position
|
25
|
-
self.position =
|
25
|
+
self.position = self.class.count + 1
|
26
26
|
end
|
27
27
|
|
28
28
|
def reorder_lower_items
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: couchdb_acts_as_list
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.1.
|
4
|
+
version: 0.0.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-07-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -98,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
98
|
version: '0'
|
99
99
|
requirements: []
|
100
100
|
rubyforge_project:
|
101
|
-
rubygems_version: 1.8.
|
101
|
+
rubygems_version: 1.8.25
|
102
102
|
signing_key:
|
103
103
|
specification_version: 3
|
104
104
|
summary: Implementation of the acts as list gem for CouchDB
|