Sha256: b57343599373c04b4230e3015cc259954b92166d154cff63d6eeb4c903f53e97

Contents?: true

Size: 901 Bytes

Versions: 2

Compression:

Stored size: 901 Bytes

Contents

# UniqNumberId

Create uniques random number id for any model in ruby on rails.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'uniq_number_id'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install uniq_number_id

## Usage

Example using Active Record:

```ruby
# Schema: User(member_number:integer)
class User < ActiveRecord::Base
uniq_number_id :member_number, length: 5 # default length 8
end

user = User.new
user.save
user.member_number # => 17263
user.renew_member_number # => true, will update member_number with a new number
```

## Contributing

1. Fork it ( https://github.com/[my-github-username]/uniq_number_id/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
uniq_number_id-0.0.2 README.md
uniq_number_id-0.0.1 README.md