hubrise_app 1.2.8 → 1.2.10
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 +4 -4
- data/README.md +3 -1
- data/app/lib/hubrise_app/refresher/account.rb +1 -1
- data/app/lib/hubrise_app/refresher/app_instance.rb +6 -6
- data/app/lib/hubrise_app/refresher/base.rb +3 -3
- data/app/lib/hubrise_app/refresher/catalog.rb +7 -7
- data/app/lib/hubrise_app/refresher/customer_list.rb +1 -1
- data/app/lib/hubrise_app/refresher/location.rb +1 -1
- data/lib/hubrise_app/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e435b02fdb6641bc369109af64cf179d56d1367cc3e9e07f1c6a8e0d556746b7
|
|
4
|
+
data.tar.gz: a32ce8a9489800b3d5d4ff27fa0580c9dcddc8ef21d4039e012076ff79fad7cb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9c97eb708cf6b1c144c3f7e4b98535865459f3b20ecad0fa0726eab3deca04bf59252e963162d8484deae9c8ecca7910d26049f47674eb0c940ad8aab7017e15
|
|
7
|
+
data.tar.gz: 9bbf933c075b7b3de8a16095aa0434ca7b49315f50e9feaa3ddfbc7eadde0ff16626f57a0b936687f017f5807da38f397600c606f44f215943a9bd182b47afcb
|
data/README.md
CHANGED
|
@@ -99,8 +99,10 @@ bundle exec rspec
|
|
|
99
99
|
3. Tag the repository:
|
|
100
100
|
|
|
101
101
|
```bash
|
|
102
|
-
VERSION=1.2.
|
|
102
|
+
VERSION=1.2.10
|
|
103
|
+
sed -i "s/VERSION = \".*\"/VERSION = \"$VERSION\"/" lib/hubrise_app/version.rb
|
|
103
104
|
bundle install
|
|
105
|
+
git add README.md
|
|
104
106
|
git add Gemfile.lock
|
|
105
107
|
git add lib/hubrise_app/version.rb
|
|
106
108
|
git commit -m "Version $VERSION"
|
|
@@ -22,17 +22,17 @@ module HubriseApp
|
|
|
22
22
|
resource
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
-
def from_event(resource, event_params)
|
|
25
|
+
def from_event(resource, event_params, api_client)
|
|
26
26
|
case event_params["resource_type"]
|
|
27
27
|
when "account"
|
|
28
|
-
HubriseApp::Refresher::Account.from_event(resource.account, event_params)
|
|
28
|
+
HubriseApp::Refresher::Account.from_event(resource.account, event_params, api_client)
|
|
29
29
|
when "location"
|
|
30
|
-
HubriseApp::Refresher::Location.from_event(resource.location, event_params)
|
|
31
|
-
HubriseApp::Refresher::Account.from_event(resource.account, event_params)
|
|
30
|
+
HubriseApp::Refresher::Location.from_event(resource.location, event_params, api_client)
|
|
31
|
+
HubriseApp::Refresher::Account.from_event(resource.account, event_params, api_client)
|
|
32
32
|
when "catalog"
|
|
33
|
-
HubriseApp::Refresher::Catalog.from_event(resource.catalog, event_params)
|
|
33
|
+
HubriseApp::Refresher::Catalog.from_event(resource.catalog, event_params, api_client)
|
|
34
34
|
when "customer_list"
|
|
35
|
-
HubriseApp::Refresher::CustomerList.from_event(resource.customer_list, event_params)
|
|
35
|
+
HubriseApp::Refresher::CustomerList.from_event(resource.customer_list, event_params, api_client)
|
|
36
36
|
end
|
|
37
37
|
end
|
|
38
38
|
|
|
@@ -16,11 +16,11 @@ module HubriseApp
|
|
|
16
16
|
end
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
def from_event(resource, event_params)
|
|
19
|
+
def from_event(resource, event_params, api_client)
|
|
20
20
|
return if resource.nil?
|
|
21
21
|
|
|
22
22
|
resource.update!(
|
|
23
|
-
attributes_from_event(event_params).merge(
|
|
23
|
+
attributes_from_event(event_params, api_client).merge(
|
|
24
24
|
refreshed_at: Time.now,
|
|
25
25
|
)
|
|
26
26
|
)
|
|
@@ -44,7 +44,7 @@ module HubriseApp
|
|
|
44
44
|
{}
|
|
45
45
|
end
|
|
46
46
|
|
|
47
|
-
def attributes_from_event(event_params)
|
|
47
|
+
def attributes_from_event(event_params, _api_client)
|
|
48
48
|
event_params
|
|
49
49
|
end
|
|
50
50
|
|
|
@@ -5,22 +5,22 @@ module HubriseApp
|
|
|
5
5
|
class << self
|
|
6
6
|
def attributes_from_api_call(resource, api_client)
|
|
7
7
|
{
|
|
8
|
-
api_data:
|
|
9
|
-
api_client.get_catalog(resource.hr_id, hide_data: true).data
|
|
10
|
-
),
|
|
8
|
+
api_data: fetch_api_data(resource.hr_id, api_client),
|
|
11
9
|
}
|
|
12
10
|
end
|
|
13
11
|
|
|
14
|
-
def attributes_from_event(event_params)
|
|
12
|
+
def attributes_from_event(event_params, api_client)
|
|
15
13
|
{
|
|
16
|
-
api_data:
|
|
14
|
+
api_data:
|
|
15
|
+
# Catalog update events do not contain "new_state", so we need to fetch from the API
|
|
16
|
+
fetch_api_data(event_params["id"], api_client),
|
|
17
17
|
}
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
private
|
|
21
21
|
|
|
22
|
-
def
|
|
23
|
-
|
|
22
|
+
def fetch_api_data(catalog_id, api_client)
|
|
23
|
+
api_client.get_catalog(catalog_id, hide_data: true).data.except("id")
|
|
24
24
|
end
|
|
25
25
|
end
|
|
26
26
|
end
|
data/lib/hubrise_app/version.rb
CHANGED