Created
October 2, 2008 02:17
-
-
Save methodmissing/14257 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
| #abstract/database_statements.rb | |
| # Returns the last auto-generated ID from the affected table. | |
| def insert_sql(sql, name = nil, pk = nil, id_value = nil, sequence_name = nil) | |
| execute(sql, name) | |
| id_value | |
| end | |
| #mysql_adapter.rb | |
| def insert_sql(sql, name = nil, pk = nil, id_value = nil, sequence_name = nil) #:nodoc: | |
| super sql, name | |
| id_value || @connection.insert_id | |
| end | |
| #mysql_adapter.rb, perhaps less GC | |
| def insert_sql(sql, name = nil, pk = nil, id_value = nil, sequence_name = nil) #:nodoc: | |
| @connection.query_with_result = false | |
| super sql, name | |
| id_value || @connection.insert_id | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment