Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
schpet authored Aug 19, 2024
1 parent 531f21c commit a40f3c6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# cool_id
# cool id

a gem for rails that generates string primary key ids for active record models with a per-model prefix followed by a nanoid. this lets you create stripe style ids in your own rails app, and they'll be the same ids you see in your database.
gem for rails apps to generates string ids with a prefix, followed by a [nanoid](https://zelark.github.io/nano-id-cc/). similar to the ids you see in stripe's api. also able to lookup any record by id, similar to rails' globalid.

```ruby
class User < ActiveRecord::Base
Expand All @@ -12,7 +12,7 @@ User.create!(name: "...").id
# => "usr_vktd1b5v84lr"
```

it can also lookup records similar to global id:
lookup any record by its id

```ruby
CoolId.locate("usr_vktd1b5v84lr")
Expand Down

0 comments on commit a40f3c6

Please sign in to comment.