mongoid_listable 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mongoid/lists.rb +1 -5
- data/mongoid_listable.gemspec +1 -1
- metadata +1 -1
data/lib/mongoid/lists.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Mongoid
|
2
2
|
|
3
3
|
# This module contains the core macro for defining listable has_many relationships
|
4
|
-
#
|
4
|
+
#
|
5
5
|
module Lists
|
6
6
|
|
7
7
|
extend ActiveSupport::Concern
|
@@ -30,10 +30,6 @@ module Mongoid
|
|
30
30
|
ids.each_with_index do |id, index|
|
31
31
|
meta.klass.find(id).update_attribute field_name, index + 1
|
32
32
|
end
|
33
|
-
|
34
|
-
meta.klass.where(meta.foreign_key => id).not_in(id: ids).each do |obj|
|
35
|
-
obj.update_attribute field_name, nil
|
36
|
-
end
|
37
33
|
end
|
38
34
|
|
39
35
|
meta[:order] ||= "#{field_name} asc"
|
data/mongoid_listable.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'mongoid_listable'
|
7
|
-
spec.version = '0.0.
|
7
|
+
spec.version = '0.0.5'
|
8
8
|
spec.authors = [ 'richardcalahan' ]
|
9
9
|
spec.email = [ 'richard@calahan.me' ]
|
10
10
|
spec.description = ''
|