* Added basic import support for PostgreSQL.
* Requiring database adapter is now "require 'ar-extensions/import/<adapter_name>" so it won't conflict with previous versions of ar-extensions or other libraries extracted out of older ar-extensions, which "require 'ar-extensions'"
This commit is contained in:
parent
075104a944
commit
3523138a7a
10 changed files with 54 additions and 16 deletions
|
@ -77,10 +77,13 @@ describe "#import" do
|
|||
topic = Generate(:topic, :title => "foobar")
|
||||
assert_no_difference "Topic.count" do
|
||||
begin
|
||||
topic.title = "baz"
|
||||
Topic.import [topic]
|
||||
Topic.transaction do
|
||||
topic.title = "baz"
|
||||
Topic.import [topic]
|
||||
end
|
||||
rescue Exception
|
||||
# no-op
|
||||
# PostgreSQL raises PgError due to key constraints
|
||||
# I don't know why ActiveRecord doesn't catch these. *sigh*
|
||||
end
|
||||
end
|
||||
assert_equal "foobar", topic.reload.title
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue