Module: Uniquify::ClassMethods
- Defined in:
- lib/uniquify-uuid.rb
Instance Method Summary collapse
Instance Method Details
#uniquify(*args, &block) ⇒ Object
13 14 15 16 17 18 |
# 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 |