multi_insert 0.1.6 → 0.1.7

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: 6532ebc746eaa544c406349ddd1817bc149046a7
4
- data.tar.gz: 8ebbc32e07ee43e5958c96c0dbdf04e45a172b46
3
+ metadata.gz: 14fe30a32e5c6287987c5ef9c096ac641711c65a
4
+ data.tar.gz: 5c08654357b2f14e7599a9a63f9246d821c31223
5
5
  SHA512:
6
- metadata.gz: ac08e898e86852fa1bf278a36b9900058ed8f1881d93e8bbfb27ea068aaf521646c040d38599d3871ff2c2a02b9d63a860732355d931fc00c00f5e3a11cb334c
7
- data.tar.gz: 49fab8f4e8ac646e09b64dd2b1951179bf102150ca89ff3174263c91e75ee98895bb937ab2971e7c35b7a96f49632080fe9a1be51f526a4fc624d4ef5c6211fb
6
+ metadata.gz: f5b0e2453ac9474b8d7f37d69af7911bbe800e3c46f55949ce66e45f465b91bb3228ba1b392be125343b1650accb033d9cec751dc7d29529d3d6190b61e3bc8f
7
+ data.tar.gz: 66f3ccccc3d543da757f4f627b1b165dde379f9ccf70c15ebac9ab1ea078cd008e226795da6fdd306e5a5b6f0cd75692c2e0d35dc7fb1f7ba5d196939174e2ff
@@ -5,7 +5,7 @@ module MultiInsert
5
5
  class Query
6
6
  def initialize(table, columns, values, opts = {})
7
7
  @table = table.to_sym
8
- @sql_insert = ::MultiInsert::QueryBuilder.insert(table, columns, values, opts = {})
8
+ @sql_insert = ::MultiInsert::QueryBuilder.insert(table, columns, values, opts)
9
9
  end
10
10
 
11
11
  def returning(columns)
@@ -2,10 +2,14 @@ require 'active_record'
2
2
 
3
3
  module MultiInsert
4
4
  module QueryBuilder
5
+ INSERT_DEFAULTS = {
6
+ time: true
7
+ }
8
+
5
9
  def self.insert(table, columns, values, opts = {})
6
10
  ar = ActiveRecord::Base.connection
7
11
 
8
- opts.merge!({time: true})
12
+ opts = INSERT_DEFAULTS.merge(opts)
9
13
 
10
14
  now = Time.now.to_s(:db) if opts[:time]
11
15
  table = ar.quote_table_name(table.to_s)
@@ -1,3 +1,3 @@
1
1
  module MultiInsert
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: multi_insert
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nax