Here is a slightly modified Taryn East’s version:
Model.maximum(:id).next
# or
Model.calculate(:maximum, :id).next
Sources:
#maximum @ ActiveRecord::Calculations
#next @ Integer
Here is a slightly modified Taryn East’s version:
Model.maximum(:id).next
# or
Model.calculate(:maximum, :id).next
Sources:
#maximum @ ActiveRecord::Calculations
#next @ Integer