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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: 13ce75b253568cef707efd8bfefc9a36c528426b
4
- data.tar.gz: eb17e324405d6a4a6845df7338f16f4e348d3242
2
+ SHA1:
3
+ metadata.gz: 95df94f73a8a62ab1a0b2e44ad4d3f15aed0f515
4
+ data.tar.gz: 77fbcee3249573fa0404a035d9a14fc049b21be7
5
5
  SHA512:
6
- metadata.gz: a81e923d8f4c7c5f0472df99d90a45a3bf37fedf6a87c897ba989ddad7de6c194f84d79a2db3431506fd974d7023023151ad685bccbc8740ac17b57343b69d2b
7
- data.tar.gz: ab820d32511412cda5f7730587a29697d147e720c3ad51ec106b089eeb0d70a4be112fd8dcfdaa2098c6a1af38b512e7ec0fe320a3b36833e1c83e30964fcc0f
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`](#pattern-pattern) option, which allows for very low-level control of the precise
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
@@ -54,7 +54,7 @@ module Mongoid
54
54
 
55
55
  def override_to_param(options)
56
56
  self.send(:define_method, :to_param) do
57
- self.send(options.field_name) || super(*args)
57
+ self.send(options.field_name) || super()
58
58
  end
59
59
  end
60
60
  end
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module MongoidToken
2
- VERSION = "2.1.0"
2
+ VERSION = "2.1.1"
3
3
  end
@@ -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.0
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-07-12 00:00:00.000000000 Z
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: []