activerecord-import-vertica 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 370f094b67fc7a91826540204cc42094c795793b
4
- data.tar.gz: baac14bbb1e2c80bc10f529dc81ffe15f22e4792
3
+ metadata.gz: 67c6f562f4c064fececcc04ea0c19b4a5417e3ea
4
+ data.tar.gz: 0a5b6a344e7fabedcaf2e7fbde0aa4d7ee0280be
5
5
  SHA512:
6
- metadata.gz: e15b656a2116606ca0c735b2ed71e227033191d3714c4e21baaae66e7a5557ebfb111c7f94c52e447bd06b3e30ea9483760eba85e335a91b2d29a5f9e2a3bb77
7
- data.tar.gz: 9257cae3b4eb35b097632730d774a242dc03930d2144e6d8de9d61f741e28e467b87f59c2598b6977d006817cd58abc92ac9ff9c6c63774ead18b79b9a7470ce
6
+ metadata.gz: 3541cd0714fdd5e71bbffd6ee1aab889f40eadb92088f32354b637f413127d60d206e9b51389080199c0334d5a24ce55c470079b47085cf6ad269d365f5af6f1
7
+ data.tar.gz: 5fb0fc9abcf7e3530afa2f34a159671caf66309a7943099f5115f40e684da102ddfd053e120a2219b0e048454b5edcbd80f4b18d74b31e2e92a02bc8f9412341
@@ -1,7 +1,7 @@
1
1
  module Activerecord
2
2
  module Import
3
3
  module Vertica
4
- VERSION = "0.0.3"
4
+ VERSION = "0.0.4"
5
5
  end
6
6
  end
7
7
  end
@@ -8,3 +8,22 @@ module Activerecord
8
8
  end
9
9
  end
10
10
  end
11
+
12
+ # AR import loads itself inside of an activesupport load hook,
13
+ # so we have to force load the code now so that we can patch the
14
+ # import method.
15
+ module ActiveRecord
16
+ module Import
17
+ end
18
+ end
19
+ require "activerecord-import/import"
20
+
21
+ class ActiveRecord::Base
22
+ def self.import(*args)
23
+ if args.flatten.first.is_a?(::ActiveRecord::Base)
24
+ bulk_insert_records(*args)
25
+ else
26
+ bulk_insert(*args)
27
+ end
28
+ end
29
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-import-vertica
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Stien
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-14 00:00:00.000000000 Z
11
+ date: 2014-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord-import