acts_as_list_mongoid 0.2.5 → 0.2.5.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -3,10 +3,14 @@ source :rubygems
3
3
  gem 'mongoid', '>= 2.0.1'
4
4
  gem "mongoid_embedded_helper", '>= 0.2.5'
5
5
 
6
- group :development do
7
- gem "shoulda", ">= 0"
6
+ group :test, :development do
8
7
  gem "cutter", ">= 0"
8
+ gem "shoulda", ">= 0"
9
+ gem 'bson_ext', '>= 1.5.1'
9
10
  gem "rspec", ">= 2.5"
11
+ end
12
+
13
+ group :development do
10
14
  gem "bundler", ">= 1.0.10"
11
15
  gem "jeweler", ">= 1.6.4"
12
16
  gem "rcov", ">= 0"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.5
1
+ 0.2.5.1
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{acts_as_list_mongoid}
8
- s.version = "0.2.5"
8
+ s.version = "0.2.5.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [%q{Kristian Mandrup}]
12
- s.date = %q{2012-01-17}
12
+ s.date = %q{2012-01-19}
13
13
  s.description = %q{Make your Mongoid model acts as a list. This acts_as extension provides the capabilities for sorting and reordering a number of objects in a list.
14
14
  The instances that take part in the list should have a +position+ field of type Integer.}
15
15
  s.email = %q{kmandrup@gmail.com}
@@ -46,8 +46,9 @@ Gem::Specification.new do |s|
46
46
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
47
47
  s.add_runtime_dependency(%q<mongoid>, [">= 2.0.1"])
48
48
  s.add_runtime_dependency(%q<mongoid_embedded_helper>, [">= 0.2.5"])
49
- s.add_development_dependency(%q<shoulda>, [">= 0"])
50
49
  s.add_development_dependency(%q<cutter>, [">= 0"])
50
+ s.add_development_dependency(%q<shoulda>, [">= 0"])
51
+ s.add_development_dependency(%q<bson_ext>, [">= 1.5.1"])
51
52
  s.add_development_dependency(%q<rspec>, [">= 2.5"])
52
53
  s.add_development_dependency(%q<bundler>, [">= 1.0.10"])
53
54
  s.add_development_dependency(%q<jeweler>, [">= 1.6.4"])
@@ -55,8 +56,9 @@ Gem::Specification.new do |s|
55
56
  else
56
57
  s.add_dependency(%q<mongoid>, [">= 2.0.1"])
57
58
  s.add_dependency(%q<mongoid_embedded_helper>, [">= 0.2.5"])
58
- s.add_dependency(%q<shoulda>, [">= 0"])
59
59
  s.add_dependency(%q<cutter>, [">= 0"])
60
+ s.add_dependency(%q<shoulda>, [">= 0"])
61
+ s.add_dependency(%q<bson_ext>, [">= 1.5.1"])
60
62
  s.add_dependency(%q<rspec>, [">= 2.5"])
61
63
  s.add_dependency(%q<bundler>, [">= 1.0.10"])
62
64
  s.add_dependency(%q<jeweler>, [">= 1.6.4"])
@@ -65,8 +67,9 @@ Gem::Specification.new do |s|
65
67
  else
66
68
  s.add_dependency(%q<mongoid>, [">= 2.0.1"])
67
69
  s.add_dependency(%q<mongoid_embedded_helper>, [">= 0.2.5"])
68
- s.add_dependency(%q<shoulda>, [">= 0"])
69
70
  s.add_dependency(%q<cutter>, [">= 0"])
71
+ s.add_dependency(%q<shoulda>, [">= 0"])
72
+ s.add_dependency(%q<bson_ext>, [">= 1.5.1"])
70
73
  s.add_dependency(%q<rspec>, [">= 2.5"])
71
74
  s.add_dependency(%q<bundler>, [">= 1.0.10"])
72
75
  s.add_dependency(%q<jeweler>, [">= 1.6.4"])
@@ -19,14 +19,12 @@ module ActsAsList
19
19
  def acts_as_list(options = {})
20
20
  configuration = { :column => 'position' }
21
21
  configuration.update(options) if options.is_a?(Hash)
22
- if configuration[:scope].is_a?(Symbol)
23
- if configuration[:scope].to_s == "_type"
24
- configuration[:scope] = "#{configuration[:scope]}".intern
25
- elsif configuration[:scope].to_s !~ /_id$/
26
- configuration[:scope] = "#{configuration[:scope]}_id".intern
27
- end
22
+
23
+ if configuration[:scope]
24
+ configuration[:scope] = configuration[:scope].to_sym
25
+ configuration[:scope] = "#{configuration[:scope]}_id".intern if configuration[:scope].to_s !~ /_id$/
28
26
  end
29
-
27
+
30
28
  define_method :position_column do
31
29
  configuration[:column].to_s
32
30
  end
@@ -40,7 +38,7 @@ module ActsAsList
40
38
  {configuration[:scope] => self[configuration[:scope]]}
41
39
  end
42
40
  else
43
- raise ArgumentError, "acts_as_list must either take a valid scope option or be in an embedded document and use the parent document as scope"
41
+ raise ArgumentError, "acts_as_list must either take a valid :scope option or be in an embedded document and use the parent document as scope"
44
42
  end
45
43
 
46
44
  include ::Mongoid::EmbeddedHelper
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_list_mongoid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.5.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-17 00:00:00.000000000Z
12
+ date: 2012-01-19 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mongoid
16
- requirement: &70214266039340 !ruby/object:Gem::Requirement
16
+ requirement: &70305272417560 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 2.0.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70214266039340
24
+ version_requirements: *70305272417560
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: mongoid_embedded_helper
27
- requirement: &70214266037400 !ruby/object:Gem::Requirement
27
+ requirement: &70305272414840 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 0.2.5
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70214266037400
35
+ version_requirements: *70305272414840
36
36
  - !ruby/object:Gem::Dependency
37
- name: shoulda
38
- requirement: &70214266034740 !ruby/object:Gem::Requirement
37
+ name: cutter
38
+ requirement: &70305272413580 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70214266034740
46
+ version_requirements: *70305272413580
47
47
  - !ruby/object:Gem::Dependency
48
- name: cutter
49
- requirement: &70214266027360 !ruby/object:Gem::Requirement
48
+ name: shoulda
49
+ requirement: &70305272411600 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,21 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70214266027360
57
+ version_requirements: *70305272411600
58
+ - !ruby/object:Gem::Dependency
59
+ name: bson_ext
60
+ requirement: &70305272409340 !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: 1.5.1
66
+ type: :development
67
+ prerelease: false
68
+ version_requirements: *70305272409340
58
69
  - !ruby/object:Gem::Dependency
59
70
  name: rspec
60
- requirement: &70214266026340 !ruby/object:Gem::Requirement
71
+ requirement: &70305272398740 !ruby/object:Gem::Requirement
61
72
  none: false
62
73
  requirements:
63
74
  - - ! '>='
@@ -65,10 +76,10 @@ dependencies:
65
76
  version: '2.5'
66
77
  type: :development
67
78
  prerelease: false
68
- version_requirements: *70214266026340
79
+ version_requirements: *70305272398740
69
80
  - !ruby/object:Gem::Dependency
70
81
  name: bundler
71
- requirement: &70214266025060 !ruby/object:Gem::Requirement
82
+ requirement: &70305272396880 !ruby/object:Gem::Requirement
72
83
  none: false
73
84
  requirements:
74
85
  - - ! '>='
@@ -76,10 +87,10 @@ dependencies:
76
87
  version: 1.0.10
77
88
  type: :development
78
89
  prerelease: false
79
- version_requirements: *70214266025060
90
+ version_requirements: *70305272396880
80
91
  - !ruby/object:Gem::Dependency
81
92
  name: jeweler
82
- requirement: &70214266024120 !ruby/object:Gem::Requirement
93
+ requirement: &70305272385980 !ruby/object:Gem::Requirement
83
94
  none: false
84
95
  requirements:
85
96
  - - ! '>='
@@ -87,10 +98,10 @@ dependencies:
87
98
  version: 1.6.4
88
99
  type: :development
89
100
  prerelease: false
90
- version_requirements: *70214266024120
101
+ version_requirements: *70305272385980
91
102
  - !ruby/object:Gem::Dependency
92
103
  name: rcov
93
- requirement: &70214266023260 !ruby/object:Gem::Requirement
104
+ requirement: &70305272381700 !ruby/object:Gem::Requirement
94
105
  none: false
95
106
  requirements:
96
107
  - - ! '>='
@@ -98,7 +109,7 @@ dependencies:
98
109
  version: '0'
99
110
  type: :development
100
111
  prerelease: false
101
- version_requirements: *70214266023260
112
+ version_requirements: *70305272381700
102
113
  description: ! "Make your Mongoid model acts as a list. This acts_as extension provides
103
114
  the capabilities for sorting and reordering a number of objects in a list.\n The
104
115
  instances that take part in the list should have a +position+ field of type Integer."
@@ -139,7 +150,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
139
150
  version: '0'
140
151
  segments:
141
152
  - 0
142
- hash: 1707925760509279057
153
+ hash: 3541753951369195128
143
154
  required_rubygems_version: !ruby/object:Gem::Requirement
144
155
  none: false
145
156
  requirements: