@@ -911,8 +911,8 @@ private static String[] createStatementPk(IRubyObject pk) {
911
911
* @return ActiveRecord::Result
912
912
* @throws SQLException
913
913
*/
914
- @ JRubyMethod (name = "execute_insert " , required = 2 )
915
- public IRubyObject execute_insert (final ThreadContext context , final IRubyObject sql , final IRubyObject pk ) {
914
+ @ JRubyMethod (name = "execute_insert_pk " , required = 2 )
915
+ public IRubyObject execute_insert_pk (final ThreadContext context , final IRubyObject sql , final IRubyObject pk ) {
916
916
return withConnection (context , new Callable <IRubyObject >() {
917
917
public IRubyObject call (final Connection connection ) throws SQLException {
918
918
Statement statement = null ;
@@ -939,6 +939,12 @@ public IRubyObject call(final Connection connection) throws SQLException {
939
939
});
940
940
}
941
941
942
+ @ Deprecated
943
+ @ JRubyMethod (name = "execute_insert" , required = 1 )
944
+ public IRubyObject execute_insert (final ThreadContext context , final IRubyObject sql ) {
945
+ return execute_insert_pk (context , sql , context .nil );
946
+ }
947
+
942
948
/**
943
949
* Executes an INSERT SQL statement using a prepared statement
944
950
* @param context
@@ -948,9 +954,9 @@ public IRubyObject call(final Connection connection) throws SQLException {
948
954
* @return ActiveRecord::Result
949
955
* @throws SQLException
950
956
*/
951
- @ JRubyMethod (name = "execute_insert " , required = 3 )
952
- public IRubyObject execute_insert (final ThreadContext context , final IRubyObject sql , final IRubyObject binds ,
953
- final IRubyObject pk ) {
957
+ @ JRubyMethod (name = "execute_insert_pk " , required = 3 )
958
+ public IRubyObject execute_insert_pk (final ThreadContext context , final IRubyObject sql , final IRubyObject binds ,
959
+ final IRubyObject pk ) {
954
960
return withConnection (context , new Callable <IRubyObject >() {
955
961
public IRubyObject call (final Connection connection ) throws SQLException {
956
962
PreparedStatement statement = null ;
@@ -976,6 +982,12 @@ public IRubyObject call(final Connection connection) throws SQLException {
976
982
});
977
983
}
978
984
985
+ @ Deprecated
986
+ @ JRubyMethod (name = "execute_insert" , required = 2 )
987
+ public IRubyObject execute_insert (final ThreadContext context , final IRubyObject binds , final IRubyObject sql ) {
988
+ return execute_insert_pk (context , sql , binds , context .nil );
989
+ }
990
+
979
991
/**
980
992
* Executes an UPDATE (DELETE) SQL statement
981
993
* @param context
0 commit comments