module Uniquify::ClassMethods

Public Instance Methods

uniquify(*args, &block) click to toggle source
# File lib/uniquify-uuid.rb, line 13
def uniquify *args, &block
  args.each do |name|
    block = Proc.new { Uniquify::UUID.generate } unless block_given?
    before_create { |record| record.ensure_unique(name, &block) }
  end
end