https://github.com/sixarm/sixarm_ruby_active_record_uuid
SixArm.com » Ruby » ActiveRecord UUID for creating models with universal id values
https://github.com/sixarm/sixarm_ruby_active_record_uuid
activerecord gem rails ruby uuid
Last synced: over 1 year ago
JSON representation
SixArm.com » Ruby » ActiveRecord UUID for creating models with universal id values
- Host: GitHub
- URL: https://github.com/sixarm/sixarm_ruby_active_record_uuid
- Owner: SixArm
- License: other
- Created: 2010-12-13T21:44:15.000Z (over 15 years ago)
- Default Branch: main
- Last Pushed: 2023-09-15T19:27:39.000Z (almost 3 years ago)
- Last Synced: 2025-02-06T00:26:12.410Z (over 1 year ago)
- Topics: activerecord, gem, rails, ruby, uuid
- Language: Ruby
- Homepage: http://sixarm.com
- Size: 248 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# SixArm.com → Ruby →
ActiveRecordUUID module to use UUID for ActiveRecord id
* Doc:
* Gem:
* Repo:
## Introduction
Enable Active Record models to use a UUID for the id field,
by creating a UUID in the Active Record before_save method.
Based on "Using UUID/GUID as Primary Key in Rails" by Paul Dix.
http://codesnipers.com/?q=node/143&title=using-uuid/guid-as-primary-key-in-rails
For docs go to
Want to help? We're happy to get pull requests.
## Install
### Gem
To install this gem in your shell or terminal:
gem install sixarm_ruby_active_record_uuid
### Gemfile
To add this gem to your Gemfile:
gem 'sixarm_ruby_active_record_uuid'
### Require
To require the gem in your code:
require 'sixarm_ruby_active_record_uuid'
## Example
class Item < ActiveRecord::Base
include ActiveRecordUUID
end