0.01
No commit activity in last 3 years
No release in over 3 years
Provides UUID generation for Mongoid models. It includes a validator for UUIDs.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.0.0
>= 0
>= 0
>= 0
~> 2

Runtime

~> 3.0
~> 2.3.1
 Project Readme

Vidibus::Uuid Build Status

Generates and validates compact UUIDs. Basically, this is an abstraction of http://github.com/assaf/uuid

This gem is part of Vidibus, an open source toolset for building distributed (video) applications.

Installation

Add gem "vidibus-uuid" to your Gemfile. Then call bundle install on your console.

Usage

Vidibus::Uuid.generate
# => "b063263064e0012d47b658b035f038ab"

Vidibus::Uuid.validate("b063263064e0012d47b658b035f038ab")
# => true

Usage in Mongoid model

Include the Vidibus::Uuid::Mongoid module in your Mongoid model:

class MyModel
  include Mongoid::Document
  include Vidibus::Uuid::Mongoid
end

Validation of custom attributes

To verfify that custom attributes are formatted as UUID, add the uuid validator to your model:

class MyModel
  include Mongoid::Document
  field :product_uuid
  validates :product_uuid, :uuid => {:allow_blank => true}
end

Copyright

© 2010-2012 Andre Pankratz. See LICENSE for details.