composite_primary_keys 7.0.4 → 7.0.5
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b80c3c585051897678d097a60e5e2d2e0aaf9ec3
|
4
|
+
data.tar.gz: c6b042d7c81d77f5e8e1712c9808574288ac672c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ccdf4ac7aed2c8c3856ecbcf238662f9c8e04e2a34e156542645be631e61d7d2b3299d106ee6d5c4afb911fea69bb5e7e551422e573dfcca59664854a3014a4
|
7
|
+
data.tar.gz: 61238d4592fd9ba1b9f984c233399f6ccbbc4d2b6c6abd12ebedb174cc3094557043e5034941e3b3da192560bc17cb34857e70e959026a88a786f5208cf6755e
|
data/History.rdoc
CHANGED
@@ -1,13 +1,5 @@
|
|
1
1
|
module ActiveRecord
|
2
2
|
module ConnectionAdapters
|
3
|
-
class PostgreSQLColumn
|
4
|
-
# This overide is needed to ensure ActiveRecord::Dirty behaves as expected
|
5
|
-
def type_cast(value)
|
6
|
-
return value if value.kind_of?(Array)
|
7
|
-
super
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
3
|
class PostgreSQLAdapter
|
12
4
|
def insert_sql(sql, name = nil, pk = nil, id_value = nil, sequence_name = nil)
|
13
5
|
unless pk
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require File.expand_path('../abstract_unit', __FILE__)
|
2
|
+
|
3
|
+
class EmployeesGroup < ActiveRecord::Base
|
4
|
+
|
5
|
+
end
|
6
|
+
|
7
|
+
class TestValidations < ActiveSupport::TestCase
|
8
|
+
fixtures :employees
|
9
|
+
|
10
|
+
def test_delete_for_model_without_primary_key
|
11
|
+
EmployeesGroup.create(employee_id: 1, group_id: 100)
|
12
|
+
EmployeesGroup.create(employee_id: 2, group_id: 102)
|
13
|
+
EmployeesGroup.create(employee_id: 3, group_id: 103)
|
14
|
+
|
15
|
+
assert_equal(EmployeesGroup.all.size, 3)
|
16
|
+
exception = assert_raises(ActiveRecord::StatementInvalid) {
|
17
|
+
EmployeesGroup.where(employee_id: 1).first.destroy
|
18
|
+
}
|
19
|
+
assert_match(/Unknown column 'employees_groups.' in 'where clause/, exception.message)
|
20
|
+
assert(EmployeesGroup.all.size == 3)
|
21
|
+
end
|
22
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: composite_primary_keys
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.0.
|
4
|
+
version: 7.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Charlie Savage
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -175,6 +175,7 @@ files:
|
|
175
175
|
- test/test_counter_cache.rb
|
176
176
|
- test/test_create.rb
|
177
177
|
- test/test_delete.rb
|
178
|
+
- test/test_delete_all.rb
|
178
179
|
- test/test_dup.rb
|
179
180
|
- test/test_equal.rb
|
180
181
|
- test/test_exists.rb
|
@@ -232,6 +233,7 @@ test_files:
|
|
232
233
|
- test/test_counter_cache.rb
|
233
234
|
- test/test_create.rb
|
234
235
|
- test/test_delete.rb
|
236
|
+
- test/test_delete_all.rb
|
235
237
|
- test/test_dup.rb
|
236
238
|
- test/test_equal.rb
|
237
239
|
- test/test_exists.rb
|