activerecord-ulid

Add ULID support to ActiveRecord

MIT License

Downloads
365
Stars
4
Committers
1

Activerecord::Ulid

Installation

Add this gem to your Gemfile:

gem 'activerecord-ulid'

Then, run bundle install.

Usage

in your model:

class User < ActiveRecord::Base
  attribute :id, :ulid
end

you can add a prefix to the ulid:


class User < ActiveRecord::Base
  attribute :id, :ulid, prefix: 'usr_'
end

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/seuros/activerecord-ulid.

License

The gem is available as open source under the terms of the MIT License.