Created
December 2, 2008 17:41
-
-
Save mage2k/31190 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Returns the current ID of a table's sequence. | |
| def last_insert_id(table, sequence_name) #:nodoc: | |
| Integer(select_value("SELECT currval('#{sequence_name}')")) | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment