tachyon 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dd315d416254c5c079380c2ae0d1519133cf4fac
4
- data.tar.gz: 3e847572348a3b88f6d3a1136764973b9eec9379
3
+ metadata.gz: 7882de4f67436fff7b522c0be26a0b49689bcd5e
4
+ data.tar.gz: 92c62b8cebbff5a64a1debed2c43297536fd5890
5
5
  SHA512:
6
- metadata.gz: 7829a117cf4a2efa4e69ed87d5b6a2af87d541a754a6f77cce341e47ba0aba2ae2de2b41f5ee051856edbe905e440fea8df4edc66109b1c96f16327dc3459494
7
- data.tar.gz: e705045e869b5d93e7aedec43090a1bbcc054d63967842fbe13d4332652052c0862c36308f20a7272f5f06de0765495fd9aa8e5affd6cab36b3ce5936ec38654
6
+ metadata.gz: 4c634d8836430187401b0e4ccf895c907169f7928a75e55fddf781a82fc9d4a14cc08fd2f113a791eb4d0babd1ed40942c93d6df054fb6e465d168ec688c80b3
7
+ data.tar.gz: 7e4fa020dc44fb6e4a0259000220c95712b6c6dd8c5a34717b380a7508dca82cf2a5fef06ed147a4e3ad39403ef47f63c8c8cee750f286ebd88eb44a48717d44
data/lib/tachyon.rb CHANGED
@@ -13,30 +13,8 @@ class Tachyon
13
13
  end
14
14
 
15
15
  def self.insert_record(klass, data)
16
- if klass.has_attribute?(:created_at) && klass.has_attribute?(:updated_at)
17
- defaults = { created_at: Time.now, updated_at: Time.now }.with_indifferent_access
18
- data = defaults.merge(data.with_indifferent_access)
19
- end
20
-
21
- table = klass.arel_table
22
- mapped_data = data.map do |key, value|
23
- [table[key], value]
24
- end
25
-
26
-
27
- insert = Arel::InsertManager.new
28
- insert.into(table)
29
- insert.insert(mapped_data)
30
-
31
16
  begin
32
- begin
33
- klass.connection.execute(insert.to_sql)
34
- rescue ArgumentError
35
- # If we can't generate the insert using Arel (likely because
36
- # of an issue with a serialized attribute) then fall back
37
- # to safe but slow behaviour.
38
17
  klass.new(data).save(validate: false)
39
- end
40
18
  rescue ActiveRecord::RecordNotUnique
41
19
  end
42
20
  end
@@ -1,3 +1,3 @@
1
1
  class Tachyon
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tachyon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Gough