lhs 1.3.1 → 1.4.0

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: bd943de16b65c840dc1b4b5c05ff7a8909dcf2d7
4
- data.tar.gz: ef07ef221571d7de7c2a426983b1fe060b2868c9
3
+ metadata.gz: c4d9308df49f7152059f1d2c5b243073708b3f5c
4
+ data.tar.gz: c2cf09d5ff720426922a46f858cbfda21603c899
5
5
  SHA512:
6
- metadata.gz: c1e7a9dec8966d5fcef164e81ab77b8e39e8d07d2991ccd94794c606b1615f80f1a312c0799a7d0e516cee408a2171ea312ea68013ce6148cfbd74e7f0ac9004
7
- data.tar.gz: 45ac1316587e3b26fe8c21bee179fe0a021cb7616eac8ec9cebf2c2869d646db007864cfa2cb8d2200c261c079d2ba5f86b370d327b06df8347e8d769883d995
6
+ metadata.gz: 6c6e0edeadc0e459455d358c34fb9f3e66527d8529a868eaca3c630752837eb3f4dd3bc8f205c1b587240039173ea3459d7add01cb374ae7b9662c45f4990105
7
+ data.tar.gz: fbfeed8fe2eeb6ba43eec211a1653250a016ec7aa51af4ecd0ae723a399205a2700b37220c82dfc29cf3c807d2e2e3b2b4f8e8730bd3639a7182970b5704ef06
data/README.md CHANGED
@@ -36,7 +36,7 @@ For every proxy that contains an `href` you can use `load!` or `reload!` to rece
36
36
 
37
37
  ```ruby
38
38
  {
39
- "href" => "http://datastore-stg.lb-service.sunrise.intra.local.ch/v2/content-ads/51dfc5690cf271c375c5a12d"
39
+ "href" => "http://local.ch/v2/content-ads/51dfc5690cf271c375c5a12d"
40
40
  }
41
41
 
42
42
  item.load!.id
@@ -0,0 +1,3 @@
1
+ jobs:
2
+ _cider-ci_include:
3
+ - cider-ci/jobs/tests.yml
@@ -0,0 +1,16 @@
1
+ subcontexts:
2
+
3
+ - name: 'All rspec tests'
4
+
5
+ task-defaults:
6
+
7
+ scripts:
8
+
9
+ test:
10
+
11
+ body: |
12
+ #!/usr/bin/env bash
13
+ bundle exec rspec $CIDER_CI_TASK_FILE
14
+
15
+ _cider-ci_generate-tasks:
16
+ include-match: spec/.*_spec.rb
@@ -0,0 +1,27 @@
1
+ tests:
2
+
3
+ name: 'Tests'
4
+
5
+ run-on:
6
+ - type: branch
7
+ include-match: ^.*$
8
+
9
+ context:
10
+
11
+ _cider-ci_include:
12
+ - cider-ci/contexts/rspec.yml
13
+
14
+ task-defaults:
15
+
16
+ scripts:
17
+
18
+ bundle:
19
+ body: sed 's/^source.*/source "http\:\/\/52.29.7.59:9292"/g' Gemfile > Gemfile.tmp ; mv Gemfile.tmp Gemfile && bundle install
20
+
21
+ ruby-version:
22
+ body: ruby --version
23
+
24
+ test:
25
+ start-when:
26
+ - script: bundle
27
+ - script: ruby-version
@@ -53,3 +53,20 @@ You can delete records remotely by calling `destroy` on an item.
53
53
  feedback = Feedback.find('1z-5r1fkaj')
54
54
  feedback.destroy
55
55
  ```
56
+
57
+ ## Validation
58
+
59
+ In order to validate objects before persisting them, you can use the `valid?` (`validate` alias) method.
60
+ The specific endpoint has to support validations with the `persist=false` parameter.
61
+ The endpoint has to be enabled (opt-in) for validations in the service configuration.
62
+
63
+ ```
64
+ class User < LHS::Service
65
+ endpoint ':datastore/v2/users', validates: true
66
+ end
67
+
68
+ user = User.build(email: 'im not an email address')
69
+ unless user.valid?
70
+ fail(user.errors[:email])
71
+ end
72
+ ```
@@ -241,3 +241,7 @@ end
241
241
  favorite = Favorite.includes(:place).find(1)
242
242
  favorite.place.name # local.ch AG
243
243
  ```
244
+
245
+ ## Validation
246
+
247
+ See: [Item Validation](../item.md).
@@ -0,0 +1,38 @@
1
+ require 'active_support'
2
+
3
+ class LHS::Item < LHS::Proxy
4
+
5
+ module Validation
6
+ extend ActiveSupport::Concern
7
+
8
+ def valid?
9
+ self.errors = nil
10
+ fail 'No validation endpoint found!' unless validation_endpoint
11
+ service = LHS::Service.for_url(validation_endpoint.url)
12
+ begin
13
+ service.request(
14
+ url: validation_endpoint.url,
15
+ method: :post,
16
+ params: validation_endpoint.options.fetch(:params, {}).merge(persist: false),
17
+ body: _data.to_json,
18
+ headers: {'Content-Type' => 'application/json'}
19
+ )
20
+ true
21
+ rescue LHC::Error => e
22
+ self.errors = LHS::Errors.new(e.response)
23
+ false
24
+ end
25
+ end
26
+ alias_method :validate, :valid?
27
+
28
+ private
29
+
30
+ def validation_endpoint
31
+ endpoint = _data._service.instance.find_endpoint(_data._raw)
32
+ endpoint ||= LHS::Endpoint.for_url(_data.href) if _data.href
33
+ validates = endpoint.options && endpoint.options.fetch(:validates, false)
34
+ fail 'Endpoint does not support validations!' unless validates
35
+ endpoint
36
+ end
37
+ end
38
+ end
@@ -7,6 +7,7 @@ class LHS::Item < LHS::Proxy
7
7
  include Destroy
8
8
  include Save
9
9
  include Update
10
+ include Validation
10
11
 
11
12
  delegate :present?, :blank?, :empty?, to: :_raw
12
13
 
@@ -1,3 +1,3 @@
1
1
  module LHS
2
- VERSION = "1.3.1"
2
+ VERSION = "1.4.0"
3
3
  end
@@ -4,7 +4,6 @@
4
4
  # RUBY = ruby-1.9.3-p125
5
5
  # GEMSET = location-app-${GitHub pull request id|branch name}
6
6
  # standard vars
7
- # https://jenkins.intra.local.ch/env-vars.html/
8
7
 
9
8
  if [ -z "$SKIP_RVM" ]; then
10
9
  [[ -s "/usr/local/rvm/scripts/rvm" ]] && . "/usr/local/rvm/scripts/rvm"
@@ -25,7 +25,7 @@ describe LHS::Collection do
25
25
  }
26
26
  end
27
27
 
28
- let(:datastore) { 'http://datastore-stg.lb-service.sunrise.intra.local.ch/v2' }
28
+ let(:datastore) { 'http://local.ch/v2' }
29
29
 
30
30
  before(:each) do
31
31
  LHC.config.placeholder('datastore', datastore)
@@ -2,7 +2,7 @@ require 'rails_helper'
2
2
 
3
3
  describe LHS::Collection do
4
4
 
5
- let(:datastore) { 'http://datastore-stg.lb-service.sunrise.intra.local.ch/v2' }
5
+ let(:datastore) { 'http://local.ch/v2' }
6
6
 
7
7
  before(:each) do
8
8
  LHC.config.placeholder('datastore', datastore)
@@ -14,13 +14,13 @@ describe LHS::Endpoint do
14
14
 
15
15
  it 'provides the endpoint for a given url' do
16
16
  expect(
17
- LHS::Endpoint.for_url('http://datastore.local.ch/v2/entries/123/content-ads/456/feedbacks').url
17
+ LHS::Endpoint.for_url('http://local.ch/v2/entries/123/content-ads/456/feedbacks').url
18
18
  ).to eq ':datastore/entries/:entry_id/content-ads/:campaign_id/feedbacks'
19
19
  expect(
20
- LHS::Endpoint.for_url('http://datastore.local.ch/123/feedbacks').url
20
+ LHS::Endpoint.for_url('http://local.ch/123/feedbacks').url
21
21
  ).to eq ':datastore/:campaign_id/feedbacks'
22
22
  expect(
23
- LHS::Endpoint.for_url('http://datastore.local.ch/feedbacks').url
23
+ LHS::Endpoint.for_url('http://local.ch/feedbacks').url
24
24
  ).to eq ':datastore/feedbacks'
25
25
  end
26
26
  end
@@ -11,7 +11,7 @@ describe LHS::Item do
11
11
  end
12
12
 
13
13
  let(:datastore) do
14
- 'http://datastore-stg.lb-service.sunrise.intra.local.ch'
14
+ 'http://local.ch'
15
15
  end
16
16
 
17
17
  let(:json) do
@@ -4,7 +4,7 @@ describe LHS::Item do
4
4
 
5
5
  context 'save failed' do
6
6
 
7
- let(:datastore) { 'http://datastore-stg.lb-service.sunrise.intra.local.ch/v2' }
7
+ let(:datastore) { 'http://local.ch/v2' }
8
8
 
9
9
  before(:each) do
10
10
  LHC.config.placeholder(:datastore, datastore)
@@ -0,0 +1,87 @@
1
+ require 'rails_helper'
2
+
3
+ describe LHS::Item do
4
+
5
+ let(:datastore) { 'http://local.ch' }
6
+
7
+ before(:each) do
8
+ LHC.config.placeholder('datastore', datastore)
9
+ class User < LHS::Service
10
+ endpoint ':datastore/v2/users', validates: true
11
+ end
12
+ mock_validation
13
+ end
14
+
15
+ let(:mock_validation) do
16
+ successful_validation
17
+ end
18
+
19
+ let(:successful_validation) do
20
+ stub_request(:post, "#{datastore}/v2/users?persist=false").to_return(body: '{}')
21
+ end
22
+
23
+ let(:failing_validation) do
24
+ stub_request(:post, "#{datastore}/v2/users?persist=false")
25
+ .to_return(status: 400,
26
+ body: {
27
+ field_errors: [{code: "UNSUPPORTED_PROPERTY_VALUE", "path" => [ "email" ]}]
28
+ }.to_json
29
+ )
30
+ end
31
+
32
+ context 'valid data' do
33
+ let(:user) do
34
+ User.build(email: 'steve@local.ch')
35
+ end
36
+
37
+ it 'validates' do
38
+ expect(user.valid?).to eq true
39
+ end
40
+
41
+ it 'turns to be invalid if validating on changed, invalid data' do
42
+ expect(user.valid?).to eq true
43
+ user.email = 'not a valid email'
44
+ failing_validation
45
+ expect(user.valid?).to eq false
46
+ expect(user.errors[:email]).to be
47
+ end
48
+ end
49
+
50
+ context 'invalid data' do
51
+
52
+ let(:user) do
53
+ User.build(email: 'im not an email address')
54
+ end
55
+
56
+ let(:mock_validation) do
57
+ failing_validation
58
+ end
59
+
60
+ it 'does not validate and provides error messages' do
61
+ expect(user.valid?).to eq false
62
+ expect(user.errors[:email]).to be
63
+ end
64
+
65
+ it 'resets errors when revalidating' do
66
+ expect(user.valid?).to eq false
67
+ user.email = 'steve@local.ch'
68
+ successful_validation
69
+ expect(user.valid?).to eq true
70
+ expect(user.errors).to be_nil
71
+ end
72
+ end
73
+
74
+ context 'endpoint does not support validations' do
75
+ before(:each) do
76
+ class Favorite < LHS::Service
77
+ endpoint ':datastore/v2/favorites'
78
+ end
79
+ end
80
+
81
+ it 'fails when trying to use an endpoint for validations that does not support it' do
82
+ expect(->{
83
+ Favorite.build.valid?
84
+ }).to raise_error('Endpoint does not support validations!')
85
+ end
86
+ end
87
+ end
@@ -25,7 +25,7 @@ describe LHS::Proxy do
25
25
  end
26
26
 
27
27
  before(:each) do
28
- stub_request(:get, 'http://datastore-stg.lb-service.sunrise.intra.local.ch/v2/content-ads/51dfc5690cf271c375c5a12d')
28
+ stub_request(:get, 'http://local.ch/v2/content-ads/51dfc5690cf271c375c5a12d')
29
29
  .to_return(status: 200, body: load_json(:localina_content_ad))
30
30
  end
31
31
 
@@ -38,7 +38,7 @@ describe LHS::Proxy do
38
38
 
39
39
  it 'can be reloaded' do
40
40
  expect(link.load!.id).to be
41
- stub_request(:get, 'http://datastore-stg.lb-service.sunrise.intra.local.ch/v2/content-ads/51dfc5690cf271c375c5a12d')
41
+ stub_request(:get, 'http://local.ch/v2/content-ads/51dfc5690cf271c375c5a12d')
42
42
  .to_return(status: 404)
43
43
  expect(-> { link.reload!.id })
44
44
  .to raise_error LHC::NotFound
@@ -2,7 +2,7 @@ require 'rails_helper'
2
2
 
3
3
  describe LHS::Collection do
4
4
 
5
- let(:datastore) { 'http://datastore-stg.lb-service.sunrise.intra.local.ch/v2' }
5
+ let(:datastore) { 'http://local.ch/v2' }
6
6
 
7
7
  before(:each) do
8
8
  LHC.config.placeholder('datastore', datastore)
@@ -4,7 +4,7 @@ describe LHS::Service do
4
4
 
5
5
  context 'new' do
6
6
 
7
- let(:datastore) { 'http://datastore-stg.lb-service.sunrise.intra.local.ch/v2' }
7
+ let(:datastore) { 'http://local.ch/v2' }
8
8
 
9
9
  before(:each) do
10
10
  LHC.config.placeholder('datastore', datastore)
@@ -17,7 +17,7 @@ describe LHS::Service do
17
17
  it 'builds a new item from scratch' do
18
18
  feedback = Feedback.build recommended: true
19
19
  expect(feedback.recommended).to eq true
20
- stub_request(:post, "http://datastore-stg.lb-service.sunrise.intra.local.ch/v2/feedbacks")
20
+ stub_request(:post, "http://local.ch/v2/feedbacks")
21
21
  .with(body: "{\"recommended\":true}")
22
22
  feedback.save
23
23
  end
@@ -4,7 +4,7 @@ describe LHS::Service do
4
4
 
5
5
  context 'create' do
6
6
 
7
- let(:datastore) { 'http://datastore-stg.lb-service.sunrise.intra.local.ch/v2' }
7
+ let(:datastore) { 'http://local.ch/v2' }
8
8
 
9
9
  before(:each) do
10
10
  LHC.config.placeholder('datastore', datastore)
@@ -4,7 +4,7 @@ describe LHS::Service do
4
4
 
5
5
  context 'creation failed' do
6
6
 
7
- let(:datastore) { 'http://datastore-stg.lb-service.sunrise.intra.local.ch/v2' }
7
+ let(:datastore) { 'http://local.ch/v2' }
8
8
 
9
9
  before(:each) do
10
10
  LHC.config.placeholder(:datastore, datastore)
@@ -4,7 +4,7 @@ describe LHS::Service do
4
4
 
5
5
  context 'endpoints' do
6
6
 
7
- let(:datastore) { 'http://datastore-stg.lb-service.sunrise.intra.local.ch/v2' }
7
+ let(:datastore) { 'http://local.ch/v2' }
8
8
 
9
9
  before(:each) do
10
10
  LHC.config.placeholder(:datastore, datastore)
@@ -1,7 +1,7 @@
1
1
  require 'rails_helper'
2
2
 
3
3
  describe LHS::Service do
4
- let(:datastore) { 'http://datastore-stg.lb-service.sunrise.intra.local.ch/v2' }
4
+ let(:datastore) { 'http://local.ch/v2' }
5
5
 
6
6
  before(:each) do
7
7
  LHC.config.placeholder(:datastore, datastore)
@@ -16,7 +16,7 @@ describe LHS::Collection do
16
16
  }.to_json
17
17
  end
18
18
 
19
- let(:datastore) { 'http://datastore-stg.lb-service.sunrise.intra.local.ch/v2' }
19
+ let(:datastore) { 'http://local.ch/v2' }
20
20
 
21
21
  before(:each) do
22
22
  LHC.config.placeholder('datastore', datastore)
@@ -16,7 +16,7 @@ describe LHS::Collection do
16
16
  }.to_json
17
17
  end
18
18
 
19
- let(:datastore) { 'http://datastore-stg.lb-service.sunrise.intra.local.ch/v2' }
19
+ let(:datastore) { 'http://local.ch/v2' }
20
20
 
21
21
  before(:each) do
22
22
  LHC.config.placeholder('datastore', datastore)
@@ -2,7 +2,7 @@ require 'rails_helper'
2
2
 
3
3
  describe LHS::Service do
4
4
 
5
- let(:datastore) { 'http://datastore-stg.lb-service.sunrise.intra.local.ch/v2' }
5
+ let(:datastore) { 'http://local.ch/v2' }
6
6
 
7
7
  before(:each) do
8
8
  LHC.config.placeholder(:datastore, datastore)
@@ -2,7 +2,7 @@ require 'rails_helper'
2
2
 
3
3
  describe LHS::Service do
4
4
 
5
- let(:datastore) { 'http://datastore-stg.lb-service.sunrise.intra.local.ch/v2' }
5
+ let(:datastore) { 'http://local.ch/v2' }
6
6
 
7
7
  before(:each) do
8
8
  LHC.config.placeholder(:datastore, datastore)
@@ -2,7 +2,7 @@ require 'rails_helper'
2
2
 
3
3
  describe LHS::Service do
4
4
 
5
- let(:datastore) { 'http://datastore-stg.lb-service.sunrise.intra.local.ch/v2' }
5
+ let(:datastore) { 'http://local.ch/v2' }
6
6
  before(:each) { LHC.config.placeholder('datastore', datastore) }
7
7
 
8
8
  let(:stub_campaign_request) do
@@ -4,7 +4,7 @@ describe LHS::Service do
4
4
 
5
5
  context 'mapping' do
6
6
 
7
- let(:datastore) { 'http://datastore-stg.lb-service.sunrise.intra.local.ch/v2' }
7
+ let(:datastore) { 'http://local.ch/v2' }
8
8
 
9
9
  before(:each) do
10
10
  LHC.config.placeholder('datastore', datastore)
@@ -4,7 +4,7 @@ describe LHS::Service do
4
4
 
5
5
  context 'url pattern' do
6
6
 
7
- let(:datastore) { 'http://datastore-stg.lb-service.sunrise.intra.local.ch/v2' }
7
+ let(:datastore) { 'http://local.ch/v2' }
8
8
 
9
9
  before(:each) do
10
10
  LHC.config.placeholder(:datastore, datastore)
@@ -3,7 +3,7 @@ require 'rails_helper'
3
3
  describe LHS::Service do
4
4
 
5
5
  let(:datastore) do
6
- 'http://datastore.lb-service/v2'
6
+ 'http://datastore/v2'
7
7
  end
8
8
 
9
9
  before(:each) do
@@ -1,7 +1,7 @@
1
1
  {
2
- "href": "http://datastore-stg.lb-service.sunrise.intra.local.ch/v2/feedbacks/-Sc4_pYNpqfsudzhtivfkA",
2
+ "href": "http://local.ch/v2/feedbacks/-Sc4_pYNpqfsudzhtivfkA",
3
3
  "campaign": {
4
- "href": "http://datastore-stg.lb-service.sunrise.intra.local.ch/v2/content-ads/51dfc5690cf271c375c5a12d"
4
+ "href": "http://local.ch/v2/content-ads/51dfc5690cf271c375c5a12d"
5
5
  },
6
6
  "source_id": "aaa",
7
7
  "recommended": true,
@@ -1,9 +1,9 @@
1
1
  {
2
- "href" : "http://datastore-stg.lb-service.sunrise.intra.local.ch/v2/feedbacks/?exclude_hidden=false&offset=0&limit=10",
2
+ "href" : "http://local.ch/v2/feedbacks/?exclude_hidden=false&offset=0&limit=10",
3
3
  "items" : [ {
4
- "href" : "http://datastore-stg.lb-service.sunrise.intra.local.ch/v2/feedbacks/0sdaetZ-OWVg4oBiBJ-7IQ",
4
+ "href" : "http://local.ch/v2/feedbacks/0sdaetZ-OWVg4oBiBJ-7IQ",
5
5
  "campaign" : {
6
- "href" : "http://datastore-stg.lb-service.sunrise.intra.local.ch/v2/content-ads/51dfc5690cf271c375c5a12d"
6
+ "href" : "http://local.ch/v2/content-ads/51dfc5690cf271c375c5a12d"
7
7
  },
8
8
  "source_id" : "aaa",
9
9
  "recommended" : true,
@@ -18,9 +18,9 @@
18
18
  "average_rating" : 3.0,
19
19
  "comments" : [ ]
20
20
  }, {
21
- "href" : "http://datastore-stg.lb-service.sunrise.intra.local.ch/v2/feedbacks/QsUOQWNJoB-GFUNsX7z0jg",
21
+ "href" : "http://local.ch/v2/feedbacks/QsUOQWNJoB-GFUNsX7z0jg",
22
22
  "campaign" : {
23
- "href" : "http://datastore-stg.lb-service.sunrise.intra.local.ch/v2/content-ads/51dfc5690cf271c375c5a11f"
23
+ "href" : "http://local.ch/v2/content-ads/51dfc5690cf271c375c5a11f"
24
24
  },
25
25
  "source_id" : "abcdefghs12345",
26
26
  "name" : "Steve",
@@ -38,9 +38,9 @@
38
38
  "average_rating" : 3.3333333333333335,
39
39
  "comments" : [ ]
40
40
  }, {
41
- "href" : "http://datastore-stg.lb-service.sunrise.intra.local.ch/v2/feedbacks/QynNtmpXlsEGvUJ0ekDKVw",
41
+ "href" : "http://local.ch/v2/feedbacks/QynNtmpXlsEGvUJ0ekDKVw",
42
42
  "campaign" : {
43
- "href" : "http://datastore-stg.lb-service.sunrise.intra.local.ch/v2/content-ads/51dfc56b0cf271c375c5a14d"
43
+ "href" : "http://local.ch/v2/content-ads/51dfc56b0cf271c375c5a14d"
44
44
  },
45
45
  "source_id" : "abcdefghs12345",
46
46
  "name" : "Steve",
@@ -58,9 +58,9 @@
58
58
  "average_rating" : 3.3333333333333335,
59
59
  "comments" : [ ]
60
60
  }, {
61
- "href" : "http://datastore-stg.lb-service.sunrise.intra.local.ch/v2/feedbacks/INmminYWNZwW_qNFx5peJQ",
61
+ "href" : "http://local.ch/v2/feedbacks/INmminYWNZwW_qNFx5peJQ",
62
62
  "campaign" : {
63
- "href" : "http://datastore-stg.lb-service.sunrise.intra.local.ch/v2/content-ads/51dfc56b0cf271c375c5a153"
63
+ "href" : "http://local.ch/v2/content-ads/51dfc56b0cf271c375c5a153"
64
64
  },
65
65
  "source_id" : "abcdefghs12345",
66
66
  "name" : "Steve",
@@ -78,9 +78,9 @@
78
78
  "average_rating" : 3.3333333333333335,
79
79
  "comments" : [ ]
80
80
  }, {
81
- "href" : "http://datastore-stg.lb-service.sunrise.intra.local.ch/v2/feedbacks/ltgfr0VRYDN2nxyC119wTg",
81
+ "href" : "http://local.ch/v2/feedbacks/ltgfr0VRYDN2nxyC119wTg",
82
82
  "campaign" : {
83
- "href" : "http://datastore-stg.lb-service.sunrise.intra.local.ch/v2/content-ads/51dfc56b0cf271c375c5a14c"
83
+ "href" : "http://local.ch/v2/content-ads/51dfc56b0cf271c375c5a14c"
84
84
  },
85
85
  "source_id" : "aaa",
86
86
  "recommended" : false,
@@ -95,9 +95,9 @@
95
95
  "average_rating" : 1.3333333333333333,
96
96
  "comments" : [ ]
97
97
  }, {
98
- "href" : "http://datastore-stg.lb-service.sunrise.intra.local.ch/v2/feedbacks/5dUdQP-kZ6sulN8NtpGXTw",
98
+ "href" : "http://local.ch/v2/feedbacks/5dUdQP-kZ6sulN8NtpGXTw",
99
99
  "campaign" : {
100
- "href" : "http://datastore-stg.lb-service.sunrise.intra.local.ch/v2/content-ads/51dfc56b0cf271c375c5a14c"
100
+ "href" : "http://local.ch/v2/content-ads/51dfc56b0cf271c375c5a14c"
101
101
  },
102
102
  "source_id" : "abcdefghs12345",
103
103
  "name" : "Steve",
@@ -115,9 +115,9 @@
115
115
  "average_rating" : 3.3333333333333335,
116
116
  "comments" : [ ]
117
117
  }, {
118
- "href" : "http://datastore-stg.lb-service.sunrise.intra.local.ch/v2/feedbacks/Z3KfWzIEQ3ZVCUj2IdrSNQ",
118
+ "href" : "http://local.ch/v2/feedbacks/Z3KfWzIEQ3ZVCUj2IdrSNQ",
119
119
  "campaign" : {
120
- "href" : "http://datastore-stg.lb-service.sunrise.intra.local.ch/v2/content-ads/51dfc5690cf271c375c5a12e"
120
+ "href" : "http://local.ch/v2/content-ads/51dfc5690cf271c375c5a12e"
121
121
  },
122
122
  "source_id" : "abcdefghs",
123
123
  "recommended" : true,
@@ -126,9 +126,9 @@
126
126
  "created_date" : "2014-09-10T16:57:36.254+02:00",
127
127
  "comments" : [ ]
128
128
  }, {
129
- "href" : "http://datastore-stg.lb-service.sunrise.intra.local.ch/v2/feedbacks/ZUUUeiw-Stw5Zb1baHDUzQ",
129
+ "href" : "http://local.ch/v2/feedbacks/ZUUUeiw-Stw5Zb1baHDUzQ",
130
130
  "campaign" : {
131
- "href" : "http://datastore-stg.lb-service.sunrise.intra.local.ch/v2/content-ads/51dfc5690cf271c375c5a12d"
131
+ "href" : "http://local.ch/v2/content-ads/51dfc5690cf271c375c5a12d"
132
132
  },
133
133
  "source_id" : "abcdefghs",
134
134
  "recommended" : true,
@@ -137,9 +137,9 @@
137
137
  "created_date" : "2014-09-10T16:57:32.791+02:00",
138
138
  "comments" : [ ]
139
139
  }, {
140
- "href" : "http://datastore-stg.lb-service.sunrise.intra.local.ch/v2/feedbacks/GyeWvhEtU4cYN_5T2FX2UA",
140
+ "href" : "http://local.ch/v2/feedbacks/GyeWvhEtU4cYN_5T2FX2UA",
141
141
  "campaign" : {
142
- "href" : "http://datastore-stg.lb-service.sunrise.intra.local.ch/v2/content-ads/539266ec0cf2cd754583cfa0"
142
+ "href" : "http://local.ch/v2/content-ads/539266ec0cf2cd754583cfa0"
143
143
  },
144
144
  "source_id" : "abcdefghs",
145
145
  "name" : "aa",
@@ -157,9 +157,9 @@
157
157
  "average_rating" : 3.0,
158
158
  "comments" : [ ]
159
159
  }, {
160
- "href" : "http://datastore-stg.lb-service.sunrise.intra.local.ch/v2/feedbacks/o-qTRqQGFS3Z_RPJm1f8SA",
160
+ "href" : "http://local.ch/v2/feedbacks/o-qTRqQGFS3Z_RPJm1f8SA",
161
161
  "campaign" : {
162
- "href" : "http://datastore-stg.lb-service.sunrise.intra.local.ch/v2/content-ads/51dfc56c0cf271c375c5a160"
162
+ "href" : "http://local.ch/v2/content-ads/51dfc56c0cf271c375c5a160"
163
163
  },
164
164
  "source_id" : "abcdefghs12345",
165
165
  "recommended" : true,
@@ -1,5 +1,5 @@
1
1
  {
2
- "href": "http://datastore-stg.lb-service.sunrise.intra.local.ch/v2/content-ads/51dfc5690cf271c375c5a12d",
2
+ "href": "http://local.ch/v2/content-ads/51dfc5690cf271c375c5a12d",
3
3
  "id": "51dfc5690cf271c375c5a12d",
4
4
  "product": "BKE",
5
5
  "hidden": false,
@@ -8,7 +8,7 @@
8
8
  "phone_number": "0041562227764",
9
9
  "type": "LOCALINA",
10
10
  "feedbacks": {
11
- "href": "http://datastore-stg.lb-service.sunrise.intra.local.ch/v2/content-ads/51dfc5690cf271c375c5a12d/feedbacks?exclude_hidden=false&offset=0&limit=10"
11
+ "href": "http://local.ch/v2/content-ads/51dfc5690cf271c375c5a12d/feedbacks?exclude_hidden=false&offset=0&limit=10"
12
12
  },
13
13
  "aggregated_feedback": {
14
14
  "recommendation": 1,
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: 1.3.1
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - local.ch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-23 00:00:00.000000000 Z
11
+ date: 2015-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lhc
@@ -119,6 +119,9 @@ files:
119
119
  - Gemfile
120
120
  - README.md
121
121
  - Rakefile
122
+ - cider-ci.yml
123
+ - cider-ci/contexts/rspec.yml
124
+ - cider-ci/jobs/tests.yml
122
125
  - docs/collections.md
123
126
  - docs/data.md
124
127
  - docs/examples/claim_no_include.json
@@ -134,6 +137,7 @@ files:
134
137
  - lib/lhs/concerns/item/destroy.rb
135
138
  - lib/lhs/concerns/item/save.rb
136
139
  - lib/lhs/concerns/item/update.rb
140
+ - lib/lhs/concerns/item/validation.rb
137
141
  - lib/lhs/concerns/service/all.rb
138
142
  - lib/lhs/concerns/service/batch.rb
139
143
  - lib/lhs/concerns/service/build.rb
@@ -215,6 +219,7 @@ files:
215
219
  - spec/item/save_spec.rb
216
220
  - spec/item/setter_spec.rb
217
221
  - spec/item/update_spec.rb
222
+ - spec/item/validation_spec.rb
218
223
  - spec/proxy/load_spec.rb
219
224
  - spec/rails_helper.rb
220
225
  - spec/service/all_spec.rb
@@ -326,6 +331,7 @@ test_files:
326
331
  - spec/item/save_spec.rb
327
332
  - spec/item/setter_spec.rb
328
333
  - spec/item/update_spec.rb
334
+ - spec/item/validation_spec.rb
329
335
  - spec/proxy/load_spec.rb
330
336
  - spec/rails_helper.rb
331
337
  - spec/service/all_spec.rb