Skip to content
Browse files

Fix import of multiple records in JRuby. fixes #1

  • Loading branch information...
1 parent fbd5269 commit e47d2cfbaed487bc7259cc54982cc15bacd5ad43 Luke Imhoff committed May 16, 2012
View
9 lib/activerecord-import/connection_adapters/postgresql_adapter.rb
@@ -1,6 +1,15 @@
module ActiveRecord::Import::ConnectionAdapters::PostgreSQLAdapter
extend ActiveSupport::Concern
+ def last_inserted_id(result)
+ if result.is_a? Array
+ row = result.last
+ row.fetch('id')
+ else
+ super
+ end
+ end
+
def next_value_for_sequence(sequence_name)
%{nextval('#{sequence_name}')}
end
View
2 lib/activerecord-import/version.rb
@@ -1,5 +1,5 @@
module Activerecord
module Import
- VERSION = "0.3.1"
+ VERSION = "0.3.2"
end
end

0 comments on commit e47d2cf

Please sign in to comment.
Something went wrong with that request. Please try again.