uidable 1.0.2 → 1.0.3
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/.travis.yml +11 -0
- data/README.md +11 -3
- data/lib/uidable.rb +1 -1
- data/lib/uidable/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55c85898f6d9f3b6b321e43eea4ef730ca495db7
|
4
|
+
data.tar.gz: b453dbc73825a18c60a66d2e07a2eded6dd1318a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9198359b1bfbe61c16f2a18d86fe0b6f818003f9a05a5aac423e4f4cd3acdc64095a96ea40915966c4749b98742c97272a820d1009e2e84a4543997f8712ac3
|
7
|
+
data.tar.gz: 36f8c7a8b82b35694807e5946a4aad5f4745e34165d227a167bc3dbe193a2eb11514b054004e0372a8b46264b96b4a9c49741ac339f1cc0dbb0013492d9282dd
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Uidable
|
2
2
|
|
3
|
+
[][gem]
|
4
|
+
[][travis]
|
5
|
+
[][coveralls]
|
6
|
+
|
7
|
+
[gem]: https://rubygems.org/gems/uidable
|
8
|
+
[travis]: https://travis-ci.org/sibevin/uidable
|
9
|
+
[coveralls]: https://coveralls.io/github/sibevin/uidable?branch=cover-check
|
10
|
+
|
3
11
|
Create the uid(unqiue identifier) attribute in your model or class.
|
4
12
|
|
5
13
|
## Installation
|
@@ -85,7 +93,7 @@ The uid is read only by default. You can disabled it with `read_only: false`.
|
|
85
93
|
### Uniqueness and Presence Validation
|
86
94
|
|
87
95
|
The uniqueness and presence validation is enabled by default. You can disable them with `uniqueness: false` and `presence: false`. Note that you should change your migration as well if needed.
|
88
|
-
|
96
|
+
|
89
97
|
### Set to_param
|
90
98
|
|
91
99
|
If the option `set_to_param: true` is given, the `to_param` is overrided with uid and it means you can use uid in your routes path.
|
@@ -96,14 +104,14 @@ If the option `scope: true` is given, a scope `with_uid` is created and you can
|
|
96
104
|
|
97
105
|
## Redefine Uid Generation
|
98
106
|
|
99
|
-
You override `gen_uid` method in your class/model if you want to generate your own uid. Here is an example:
|
107
|
+
You can override `gen_uid` method in your class/model if you want to generate your own uid. Here is an example:
|
100
108
|
|
101
109
|
require `random_token`
|
102
110
|
|
103
111
|
class MyModel < ActiveRecord::Base
|
104
112
|
include Uidable
|
105
113
|
uidable
|
106
|
-
|
114
|
+
|
107
115
|
private
|
108
116
|
|
109
117
|
def gen_uid
|
data/lib/uidable.rb
CHANGED
data/lib/uidable/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uidable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sibevin Wang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -79,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
79
|
version: '0'
|
80
80
|
requirements: []
|
81
81
|
rubyforge_project:
|
82
|
-
rubygems_version: 2.4.
|
82
|
+
rubygems_version: 2.4.6
|
83
83
|
signing_key:
|
84
84
|
specification_version: 4
|
85
85
|
summary: Create the uid attribute in your model or class.
|