prettyid 0.1.0 → 0.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
2
  SHA256:
3
- metadata.gz: 5f1d1eaec32642fac2fb8040eab5029eba0e11dac498e661ee1f220c8628f32e
4
- data.tar.gz: 56399f1ad4530619fbda6e71cced771336c351ddb4704a9062c127ec03c87813
3
+ metadata.gz: 0621c31030006467b9af257e9c679723d3375a6c6b21ca6b366174ec1ded4045
4
+ data.tar.gz: aac1f8629e0a906bde5b57a8c2c36a6f4132bc4b6ab5e7152449110e254b6dd8
5
5
  SHA512:
6
- metadata.gz: 7d4bb5c9a4676b3454d9e30d93d46c9d9c90a298ba0e1197896504b91150c454c37dc1711ace222135e847005de2a7822b1d38f479814c5acd74bf475cc82b8c
7
- data.tar.gz: 6a1930e2c2cec62139a846f0c6456c90d13f3a76e433275e7a2e39742af991fec9a5d442cd48777b2c2d9b624bb10389c95a29446006543555a7aa43d67b86b5
6
+ metadata.gz: cdd710ffb92b1d23cb243e2a7b059ba7bdb30503b7beb47fc66e65faec649399950706bba1a09c4d19683ce53870c59bc8b7cbc5d85444abe7215e27236fc46f
7
+ data.tar.gz: 343367e6e582c809ed7ee31ef6ad166057a1eb99034266f65dd61d0e98063175ff7a93773657baca860454555e5caf13e31e5df95eb1757486fa5a903b311e11
data/.gitignore CHANGED
@@ -9,3 +9,4 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+ *.gem
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pretty_id (0.1.0)
4
+ prettyid (0.1.0)
5
5
  activerecord (>= 4.2.0)
6
6
  activesupport (>= 4.2.0)
7
7
 
@@ -49,7 +49,7 @@ PLATFORMS
49
49
 
50
50
  DEPENDENCIES
51
51
  bundler
52
- pretty_id!
52
+ prettyid!
53
53
  rake
54
54
  rspec
55
55
  sqlite3
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2018 Pavel Gabriel
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Build Status](https://travis-ci.org/alovak/pretty_id.svg?branch=master)](https://travis-ci.org/alovak/pretty_id)
2
+
1
3
  # PrettyId
2
4
 
3
5
  How does Stripe generate object ids?
@@ -7,7 +9,13 @@ How does Stripe generate object ids?
7
9
 
8
10
  [source](https://www.quora.com/How-does-Stripe-generate-object-ids)
9
11
 
10
- With PrettyId you can generate Stripe-like IDs for your ActiveRecord models.
12
+ With PrettyId you can generate Stripe-like IDs for your ActiveRecord models:
13
+
14
+ ```
15
+ charge.id #=> ch_xxx
16
+ user.id #=> usr_xxx
17
+ transaction.id #=> txn_xxx
18
+ ```
11
19
 
12
20
  ## Usage
13
21
 
@@ -65,6 +73,8 @@ account.id #=> acc_test_....
65
73
 
66
74
  ## Installation
67
75
 
76
+ **Note** There is another gem called 'pretty_id' so I had to rename mine into prettyid. So, be careful when you install gem and require it. It's a kind'a trick you do with 'activerecord' as well ;)
77
+
68
78
  Add this line to your application's Gemfile:
69
79
 
70
80
  ```ruby
@@ -6,6 +6,10 @@ require 'active_support/concern'
6
6
  module PrettyId
7
7
  extend ActiveSupport::Concern
8
8
 
9
+ included do
10
+ self.primary_key = 'id'
11
+ end
12
+
9
13
  class_methods do
10
14
  def id_prefix=(prefix)
11
15
  @id_prefix = prefix
@@ -1,3 +1,3 @@
1
1
  module PrettyId
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prettyid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Gabriel
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-27 00:00:00.000000000 Z
11
+ date: 2018-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -106,6 +106,7 @@ files:
106
106
  - ".travis.yml"
107
107
  - Gemfile
108
108
  - Gemfile.lock
109
+ - LICENSE
109
110
  - README.md
110
111
  - Rakefile
111
112
  - bin/console