mongoid_slug 1.0.0.rc1 → 1.0.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mongoid/slug.rb +2 -1
- data/lib/mongoid/slug/version.rb +1 -1
- metadata +2 -2
data/lib/mongoid/slug.rb
CHANGED
@@ -57,7 +57,8 @@ module Mongoid
|
|
57
57
|
self.history = options[:history]
|
58
58
|
|
59
59
|
if slug_scope
|
60
|
-
|
60
|
+
scope_key = (metadata = self.reflect_on_association(slug_scope)) ? metadata.key : slug_scope
|
61
|
+
index({scope_key => 1, _slugs: 1}, {unique: true})
|
61
62
|
else
|
62
63
|
index({_slugs: 1}, {unique: true})
|
63
64
|
end
|
data/lib/mongoid/slug/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongoid_slug
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.rc2
|
5
5
|
prerelease: 6
|
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: 2012-09-
|
12
|
+
date: 2012-09-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mongoid
|