Module: Create::AutoIds

Extended by:
AutoIds
Included in:
AutoIds
Defined in:
lib/fabrial/create.rb

Instance Method Summary collapse

Instance Method Details

#next(klass) ⇒ Object

Get the next auto-incrementing id for the given klass



24
25
26
27
28
# File 'lib/fabrial/create.rb', line 24

def next(klass)
  id = @ids[klass] || 1
  @ids[klass] += 1
  id
end