15 16 17 18 19 20
# File 'lib/uniquify-uuid.rb', line 15 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