mongoid_token 2.1.0 → 2.1.1
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.
- checksums.yaml +5 -5
- data/README.md +1 -1
- data/lib/mongoid/token.rb +1 -1
- data/lib/version.rb +1 -1
- data/spec/mongoid/token_spec.rb +6 -0
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 95df94f73a8a62ab1a0b2e44ad4d3f15aed0f515
|
4
|
+
data.tar.gz: 77fbcee3249573fa0404a035d9a14fc049b21be7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fde956f76b7cdaadef645ac97187ce77d09aa730beba12f34ef003a8c86142b4310f6d74cba6636ef7397a543f1ee3523b2a93fd45ec1a7e02f24dffc8e7244e
|
7
|
+
data.tar.gz: c0eb2774d8cdbbffc606ed4a29bea8cd40462c6b9c42fe8681e6d06ecd0fbef907061f04f29e05d9fe4252ab3aab9c42b78e3249894d72c175a7f8cecf2c56dd
|
data/README.md
CHANGED
@@ -76,7 +76,7 @@ combination of the [`length`](#length-length) and [`contains`](#contains-contain
|
|
76
76
|
types of characters to use.
|
77
77
|
|
78
78
|
For when you need to generate more complex tokens, you can use the
|
79
|
-
[`pattern`](#
|
79
|
+
[`pattern`](#patterns-pattern) option, which allows for very low-level control of the precise
|
80
80
|
structure of your tokens, as well as allowing for static strings, like
|
81
81
|
prefixes, infixes or suffixes.
|
82
82
|
|
data/lib/mongoid/token.rb
CHANGED
data/lib/version.rb
CHANGED
data/spec/mongoid/token_spec.rb
CHANGED
@@ -56,6 +56,12 @@ describe Mongoid::Token do
|
|
56
56
|
expect(document.to_param).to_not eq document.token
|
57
57
|
end
|
58
58
|
|
59
|
+
it "should return id when token does not exist when calling `to_param`" do
|
60
|
+
document_class.send(:token, :override_to_param => true)
|
61
|
+
document.unset :token
|
62
|
+
expect(document.to_param).to eq document.id.to_s
|
63
|
+
end
|
64
|
+
|
59
65
|
describe "contains" do
|
60
66
|
context "with :alphanumeric" do
|
61
67
|
it "should contain only letters and numbers" do
|
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongoid_token
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicholas Bruning
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mongoid
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 4.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 4.0.0
|
27
27
|
description: Mongoid token is a gem for creating random, unique tokens for mongoid
|
@@ -32,10 +32,10 @@ executables: []
|
|
32
32
|
extensions: []
|
33
33
|
extra_rdoc_files: []
|
34
34
|
files:
|
35
|
-
- .autotest
|
36
|
-
- .gitignore
|
37
|
-
- .rspec
|
38
|
-
- .travis.yml
|
35
|
+
- ".autotest"
|
36
|
+
- ".gitignore"
|
37
|
+
- ".rspec"
|
38
|
+
- ".travis.yml"
|
39
39
|
- Gemfile
|
40
40
|
- README.md
|
41
41
|
- Rakefile
|
@@ -66,12 +66,12 @@ require_paths:
|
|
66
66
|
- lib
|
67
67
|
required_ruby_version: !ruby/object:Gem::Requirement
|
68
68
|
requirements:
|
69
|
-
- -
|
69
|
+
- - ">="
|
70
70
|
- !ruby/object:Gem::Version
|
71
71
|
version: '0'
|
72
72
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- -
|
74
|
+
- - ">="
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: '0'
|
77
77
|
requirements: []
|