An open API service indexing awesome lists of open source software.

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

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