en_masse 0.1.0 → 0.1.1

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: 073c3c43252fbd0187861dd58af4d033c0dbccad
4
- data.tar.gz: 1e5af51fd18e79c9cd57fb1e90a60b40eeb1d81b
3
+ metadata.gz: 7e933d95420678a4008ad9e6ca3bb1b228988053
4
+ data.tar.gz: 1665f92fbfe8f9d70e78e437c7723383123f3a61
5
5
  SHA512:
6
- metadata.gz: 8a9d4e2a26b68d9cb148462ade63d0868969ba864dbc1fc4fc7d8226c310e0ebc6810370dee4d9559c111c23c8e44f23fbfb4664e654a4f2676295043c0df44b
7
- data.tar.gz: f09b07f2d633e6ff0247cd9bf53433d52a3d19c65e37708c11d5bbea914da985d219d61edc4f7e7bb3c38d0e4e6f917f6db7e88018e2be04d307c6685f35ac1b
6
+ metadata.gz: 6ffc90fcd2960bdfdcba366181ce0fdcd6bd49060e6cb90bb25720d113bede7cf0726878cf2756800d7f093ab491097e2b797901e7a36a792183305a02d5406b
7
+ data.tar.gz: 42cbc31e2ba23302fb2e34dfc12573b3618ff522c6fc044b38fdb62044839779e671279f877aea0b8f6f811df865ffbb96c5b3fa3e0ae1b98751bad32d6acf0a
@@ -3,10 +3,12 @@ module EnMasse::Refinements
3
3
  refine ::ActiveRecord::Base.singleton_class do
4
4
 
5
5
  def insert_collection collection
6
- ids = allocate_ids(collection.count)
7
- collection.zip(ids).each do |record, id|
8
- record.id = id
9
- record.update_foreign_keys
6
+ if sequence_name.present?
7
+ ids = allocate_ids(collection.count)
8
+ collection.zip(ids).each do |record, id|
9
+ record.id = id
10
+ record.update_foreign_keys
11
+ end
10
12
  end
11
13
  values = collection.map{|record|
12
14
  "(#{ record.values_for_insert(column_names).join(",") })"
@@ -1,3 +1,3 @@
1
1
  module EnMasse
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: en_masse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artem Baguinski