Module: Syntax::Methods

Defined in:
lib/fg-quickgenerate.rb

Instance Method Summary collapse

Instance Method Details

#sequential(string) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/fg-quickgenerate.rb', line 12

def sequential(string)
  name = :"___autogenerated_#{string}___"

  begin
    sequence = FactoryGirl.sequence_by_name(name)
  rescue Exception => e
    sequence = FactoryGirl.create_simple_sequence(name, string)
  end

  sequence.next
end