Is there a compact way with ActiveRecord to query for what id it\'s going to use next if an object was going to be persisted to the database? In SQL, a query like this would
While accepting fig's answer I might want to draw your attention to a small thing. If you are getting the next ID to set to a particular record before saving, I think its not a good idea.
because as an example in a web based system
I'm not sure you want the last id to do what I'm thinking here, But if so this is just to draw your attention.