mongomapper_autokey 0.0.1 → 0.0.2
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 +4 -4
- data/{LICENSE.txt → LICENSE} +0 -0
- data/README.md +41 -9
- data/lib/mongomapper_autokey/version.rb +1 -1
- data/mongomapper_autokey.gemspec +3 -3
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f586607194cae020afa9763aa2139fc008501c09
|
4
|
+
data.tar.gz: 3487b23e54234fbf51542ed80d6fd8635932e9da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8d3a99d4f7bd0401bfc82d8b81841bcd17226c9aacbd84c4346b129e9d4a883d7586d379210a97521be673b1c87c560ad39e1eb7091c4c21250ba5b2a503378
|
7
|
+
data.tar.gz: 2044a09c2f8ccff1faa75d76aa7ab5f6f322fc9b5d82ed16b7d23408f57fea76a62a68a98a5faabb394ebd1a55df756ed56292672cc13ba6121cb92e9580c4b7
|
data/{LICENSE.txt → LICENSE}
RENAMED
File without changes
|
data/README.md
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# MongomapperAutokey
|
2
2
|
|
3
|
-
|
3
|
+
It's a MongoMapper plugin add incremented id in Mongomapper
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
7
|
Add this line to your application's Gemfile:
|
8
8
|
|
9
|
-
```
|
9
|
+
```
|
10
10
|
gem 'mongomapper_autokey'
|
11
11
|
```
|
12
12
|
|
@@ -20,12 +20,44 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
23
|
-
|
23
|
+
auto increment with id
|
24
24
|
|
25
|
-
|
25
|
+
```
|
26
|
+
class Product
|
27
|
+
include MongoMapper::Document
|
28
|
+
include MongoMapper::AutoKey
|
29
|
+
|
30
|
+
auto_increment_key
|
31
|
+
key :title, String
|
32
|
+
end
|
33
|
+
```
|
26
34
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
35
|
+
auto increment without id
|
36
|
+
|
37
|
+
```
|
38
|
+
class Product
|
39
|
+
include MongoMapper::Document
|
40
|
+
include MongoMapper::AutoKey
|
41
|
+
|
42
|
+
auto_increment_key :other_id
|
43
|
+
key :sku, Integer, auto_increment: true
|
44
|
+
end
|
45
|
+
```
|
46
|
+
|
47
|
+
set default value
|
48
|
+
|
49
|
+
```
|
50
|
+
class Product
|
51
|
+
include MongoMapper::Document
|
52
|
+
include MongoMapper::AutoKey
|
53
|
+
|
54
|
+
auto_increment_key default: 100000
|
55
|
+
auto_increment_key :id2, default: 100000
|
56
|
+
key :sku, Integer, auto_increment: true, default: 100000
|
57
|
+
end
|
58
|
+
```
|
59
|
+
|
60
|
+
## License
|
61
|
+
|
62
|
+
Copyright © 2015, Ye Li. Released under the MIT License
|
63
|
+
|
data/mongomapper_autokey.gemspec
CHANGED
@@ -8,9 +8,9 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = MongoMapper::Autokey::VERSION
|
9
9
|
spec.authors = ["yee.li"]
|
10
10
|
spec.email = ["yeeli@outlook.com"]
|
11
|
-
spec.summary = %q{Auto increment for
|
12
|
-
spec.description = %q{Auto increment for
|
13
|
-
spec.homepage = ""
|
11
|
+
spec.summary = %q{Auto increment for MongoMappper}
|
12
|
+
spec.description = %q{Auto increment for MongoMapper}
|
13
|
+
spec.homepage = "https://github.com/yeeli/mongomapper_autokey"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongomapper_autokey
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yee.li
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
-
description: Auto increment for
|
55
|
+
description: Auto increment for MongoMapper
|
56
56
|
email:
|
57
57
|
- yeeli@outlook.com
|
58
58
|
executables: []
|
@@ -61,7 +61,7 @@ extra_rdoc_files: []
|
|
61
61
|
files:
|
62
62
|
- ".gitignore"
|
63
63
|
- Gemfile
|
64
|
-
- LICENSE
|
64
|
+
- LICENSE
|
65
65
|
- README.md
|
66
66
|
- Rakefile
|
67
67
|
- lib/mongomapper_autokey.rb
|
@@ -69,7 +69,7 @@ files:
|
|
69
69
|
- lib/mongomapper_autokey/plucky.rb
|
70
70
|
- lib/mongomapper_autokey/version.rb
|
71
71
|
- mongomapper_autokey.gemspec
|
72
|
-
homepage:
|
72
|
+
homepage: https://github.com/yeeli/mongomapper_autokey
|
73
73
|
licenses:
|
74
74
|
- MIT
|
75
75
|
metadata: {}
|
@@ -92,5 +92,5 @@ rubyforge_project:
|
|
92
92
|
rubygems_version: 2.4.2
|
93
93
|
signing_key:
|
94
94
|
specification_version: 4
|
95
|
-
summary: Auto increment for
|
95
|
+
summary: Auto increment for MongoMappper
|
96
96
|
test_files: []
|