lhs 5.0.0 → 5.0.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8f2de0442c0fd0c96714b05351fb4c2391b92ac
|
4
|
+
data.tar.gz: 293a214e0e8f3df3e4dd1a5a6f2e126975e64f62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54c9049ccdc8e552de6f46a30d10015887cdf8f5846fa1b896b0e3b72ba3a49d69f3e31d82e1cf18ecfab4f04282fb7b2ae17f2c98e80699f21e55eb2577f1b8
|
7
|
+
data.tar.gz: a63d017d4a76de45b613f66c69c7755fd71c59dbd8f18736f58d7b435b86501e18843feea8158122c78fe31db50044a9b39f3b65f3b486d244958ae6cd928197
|
@@ -47,9 +47,13 @@ class LHS::Record
|
|
47
47
|
end
|
48
48
|
|
49
49
|
# Prevent clashing endpoints.
|
50
|
-
def sanity_check(
|
51
|
-
|
52
|
-
|
50
|
+
def sanity_check(new_endpoint)
|
51
|
+
endpoints.each do |existing_endpoint|
|
52
|
+
invalid = existing_endpoint.placeholders.sort == new_endpoint.placeholders.sort &&
|
53
|
+
existing_endpoint.url != new_endpoint.url
|
54
|
+
next unless invalid
|
55
|
+
fail "Clashing endpoints! Cannot differentiate between #{existing_endpoint.url} and #{new_endpoint.url}"
|
56
|
+
end
|
53
57
|
end
|
54
58
|
|
55
59
|
# Computes the url from params
|
data/lib/lhs/version.rb
CHANGED
@@ -10,7 +10,7 @@ describe LHS::Record do
|
|
10
10
|
endpoint ':datastore/v2/reviews'
|
11
11
|
end
|
12
12
|
}
|
13
|
-
).to raise_error
|
13
|
+
).to raise_error
|
14
14
|
expect(
|
15
15
|
lambda {
|
16
16
|
class Record < LHS::Record
|
@@ -18,7 +18,7 @@ describe LHS::Record do
|
|
18
18
|
endpoint ':datastore/v2/:campaign_id/reviews'
|
19
19
|
end
|
20
20
|
}
|
21
|
-
).to raise_error
|
21
|
+
).to raise_error
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
describe LHS::Record do
|
4
|
+
context 'build' do
|
5
|
+
let(:datastore) { 'http://local.ch/v2' }
|
6
|
+
|
7
|
+
it 'is possible to load records twice' do
|
8
|
+
class Feedback < LHS::Record
|
9
|
+
endpoint ':datastore/feedbacks'
|
10
|
+
end
|
11
|
+
|
12
|
+
class Feedback < LHS::Record
|
13
|
+
endpoint ':datastore/feedbacks'
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lhs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- https://github.com/local-ch/lhs/graphs/contributors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lhc
|
@@ -291,6 +291,7 @@ files:
|
|
291
291
|
- spec/record/find_spec.rb
|
292
292
|
- spec/record/first_spec.rb
|
293
293
|
- spec/record/includes_spec.rb
|
294
|
+
- spec/record/loading_twice_spec.rb
|
294
295
|
- spec/record/mapping_spec.rb
|
295
296
|
- spec/record/model_name_spec.rb
|
296
297
|
- spec/record/new_spec.rb
|
@@ -421,6 +422,7 @@ test_files:
|
|
421
422
|
- spec/record/find_spec.rb
|
422
423
|
- spec/record/first_spec.rb
|
423
424
|
- spec/record/includes_spec.rb
|
425
|
+
- spec/record/loading_twice_spec.rb
|
424
426
|
- spec/record/mapping_spec.rb
|
425
427
|
- spec/record/model_name_spec.rb
|
426
428
|
- spec/record/new_spec.rb
|