activerecord-jdbcvertica-adapter 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/activerecord-jdbcvertica-adapter/version.rb +1 -1
- data/lib/arjdbc/vertica/adapter.rb +12 -0
- data/spec/full_object_spec.rb +10 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8318f964be5c0fda875c96fe3c5136e02d0ff73
|
4
|
+
data.tar.gz: a9ab0afc7b2d5b5e67d6f9a80362949128c21994
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 190ff0e13bbb386942cac0d7d1f20ab723c6554de401da9f8f7677a12195a8f5b05446de9973a222aa002ab571e464e1389e410e1f01da0d61fecff010300c73
|
7
|
+
data.tar.gz: cf0b1dacef7b49c9894c51ca33e7237df99c8cbcac3ad9c3ab7e88f74d00f0f032530c9d8d8a25042d449469d5ebf668327e50c774e6a9949045b31b217d11d7
|
@@ -3,6 +3,18 @@ require 'arjdbc/vertica/column'
|
|
3
3
|
# Load a mapping for the "text" type that will actually work
|
4
4
|
::ActiveRecord::ConnectionAdapters::JdbcTypeConverter::AR_TO_JDBC_TYPES[:text] << lambda { |r| r['type_name'] =~ /varchar$/i }
|
5
5
|
|
6
|
+
# Override sequence_name to work without setting explicitly in models
|
7
|
+
module ::ActiveRecord
|
8
|
+
class Base
|
9
|
+
def self.sequence_name
|
10
|
+
"#{self.table_name}_#{self.primary_key || 'id'}_seq"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
##
|
16
|
+
# Adapter
|
17
|
+
#
|
6
18
|
module ::ArJdbc
|
7
19
|
module Vertica
|
8
20
|
ADAPTER_NAME = 'Vertica'.freeze
|
data/spec/full_object_spec.rb
CHANGED
@@ -45,6 +45,16 @@ describe ::FullObject do
|
|
45
45
|
specify { subject.must_respond_to(:boolean) }
|
46
46
|
end
|
47
47
|
|
48
|
+
describe "#create with id" do
|
49
|
+
it "sets the id if given on create" do
|
50
|
+
subject.id = 123_456
|
51
|
+
subject.string = "string"
|
52
|
+
subject.save
|
53
|
+
|
54
|
+
FullObject.find(123_456).must_equal(subject)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
48
58
|
describe "#delete" do
|
49
59
|
it "deletes a persisted record" do
|
50
60
|
subject.string = "string"
|