ecom_core 1.1.6 → 1.1.7
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/app/controllers/concerns/ecom/core/resource_typeable.rb +3 -3
- data/app/controllers/ecom/core/application_modules_controller.rb +3 -3
- data/app/controllers/ecom/core/user_roles_controller.rb +3 -3
- data/app/controllers/ecom/core/users_controller.rb +4 -4
- data/app/serializers/ecom/core/application_module_serializer.rb +1 -1
- data/app/serializers/ecom/core/lookup_serializer.rb +1 -1
- data/app/serializers/ecom/core/resource_type_serializer.rb +1 -1
- data/app/serializers/ecom/core/user_role_serializer.rb +1 -1
- data/app/serializers/ecom/core/user_serializer.rb +1 -1
- data/lib/ecom/core/version.rb +1 -1
- data/lib/ecom_core.rb +1 -1
- metadata +7 -8
- data/app/serializers/ecom/core/application_serializer.rb +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c0b15c898c1865b73c99b6c2c94eefd24830c2e5849cd04f173208bdd2e3da7
|
4
|
+
data.tar.gz: fb1f5f442e4e33d457c51656efca5d4f11c25968be4f260b0cc0f72b047040f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25e3d49560ae3e835c3673f284da580c03b12787ba84423d45f27d49dbb8f71acbc64d3dea90511aa1b363e1fd7767e50ce530d004cdfc7fb5ae317286614e1a
|
7
|
+
data.tar.gz: ca28ea1b20d10bfcb7938ee402fe60cc10a7d6a142d2b876aa722333c7d6da178fab22939768a65ec09856e971c7bfc5e9b358eb29c8ec73d84a2c4ce26e6937
|
@@ -8,13 +8,13 @@ module Ecom
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def index
|
11
|
-
render json:
|
11
|
+
render json: @clazz.all
|
12
12
|
end
|
13
13
|
|
14
14
|
def create
|
15
15
|
resource_type = @clazz.new(resource_type_params)
|
16
16
|
if resource_type.save
|
17
|
-
render json:
|
17
|
+
render json: resource_type, status: :created
|
18
18
|
else
|
19
19
|
render json: { success: false, errors: resource_type.errors }, status: :unprocessable_entity
|
20
20
|
end
|
@@ -23,7 +23,7 @@ module Ecom
|
|
23
23
|
def update
|
24
24
|
resource_type = @clazz.find(params[:id])
|
25
25
|
if resource_type.update(resource_type_params)
|
26
|
-
render json:
|
26
|
+
render json: resource_type
|
27
27
|
else
|
28
28
|
render json: { success: false, errors: resource_type.errors }, status: :unprocessable_entity
|
29
29
|
end
|
@@ -2,13 +2,13 @@ module Ecom
|
|
2
2
|
module Core
|
3
3
|
class ApplicationModulesController < ApplicationController
|
4
4
|
def index
|
5
|
-
render json:
|
5
|
+
render json: ApplicationModule.all
|
6
6
|
end
|
7
7
|
|
8
8
|
def create
|
9
9
|
application_module = ApplicationModule.new(application_module_params)
|
10
10
|
if application_module.save
|
11
|
-
render json:
|
11
|
+
render json: application_module, status: :created
|
12
12
|
else
|
13
13
|
render json: { success: false, errors: application_module.errors }, status: :unprocessable_entity
|
14
14
|
end
|
@@ -17,7 +17,7 @@ module Ecom
|
|
17
17
|
def update
|
18
18
|
application_module = ApplicationModule.find(params[:id])
|
19
19
|
if application_module.update(application_module_params)
|
20
|
-
render json:
|
20
|
+
render json: application_module
|
21
21
|
else
|
22
22
|
render json: { success: false, errors: application_module.errors }, status: :unprocessable_entity
|
23
23
|
end
|
@@ -4,14 +4,14 @@ module Ecom
|
|
4
4
|
before_action :set_user_role, only: [:update]
|
5
5
|
|
6
6
|
def index
|
7
|
-
render json:
|
7
|
+
render json: UserRole.all
|
8
8
|
end
|
9
9
|
|
10
10
|
def create
|
11
11
|
user_role = UserRole.new(user_role_params)
|
12
12
|
|
13
13
|
if user_role.save
|
14
|
-
render json:
|
14
|
+
render json: user_role, status: :created
|
15
15
|
else
|
16
16
|
render json: { success: false, errors: user_role.errors }, status: :unprocessable_entity
|
17
17
|
end
|
@@ -19,7 +19,7 @@ module Ecom
|
|
19
19
|
|
20
20
|
def update
|
21
21
|
if @user_role.update(user_role_params)
|
22
|
-
render json:
|
22
|
+
render json: @user_role
|
23
23
|
else
|
24
24
|
render json: { success: false, errors: @user_role.errors }, status: :unprocessable_entity
|
25
25
|
end
|
@@ -4,17 +4,17 @@ module Ecom
|
|
4
4
|
before_action :set_user, only: [:update]
|
5
5
|
|
6
6
|
def index
|
7
|
-
render json:
|
7
|
+
render json: User.all
|
8
8
|
end
|
9
9
|
|
10
10
|
def active
|
11
|
-
render json:
|
11
|
+
render json: User.active
|
12
12
|
end
|
13
13
|
|
14
14
|
def create
|
15
15
|
user = User.new(user_params)
|
16
16
|
if user.save
|
17
|
-
render json:
|
17
|
+
render json: user, status: :created
|
18
18
|
else
|
19
19
|
render json: { success: false, errors: user.errors }, status: :unprocessable_entity
|
20
20
|
end
|
@@ -22,7 +22,7 @@ module Ecom
|
|
22
22
|
|
23
23
|
def update
|
24
24
|
if @user.update(user_params)
|
25
|
-
render json:
|
25
|
+
render json: @user
|
26
26
|
else
|
27
27
|
render json: { success: false, errors: @user.errors }, status: :unprocessable_entity
|
28
28
|
end
|
data/lib/ecom/core/version.rb
CHANGED
data/lib/ecom_core.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ecom_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henock L.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aasm
|
@@ -53,19 +53,19 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: active_model_serializers
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 0.10.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 0.10.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: jwt
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -251,7 +251,6 @@ files:
|
|
251
251
|
- app/models/ecom/core/work_product.rb
|
252
252
|
- app/models/ecom/core/work_product_template.rb
|
253
253
|
- app/serializers/ecom/core/application_module_serializer.rb
|
254
|
-
- app/serializers/ecom/core/application_serializer.rb
|
255
254
|
- app/serializers/ecom/core/lookup_serializer.rb
|
256
255
|
- app/serializers/ecom/core/resource_type_serializer.rb
|
257
256
|
- app/serializers/ecom/core/user_role_serializer.rb
|
@@ -1,20 +0,0 @@
|
|
1
|
-
module Ecom
|
2
|
-
module Core
|
3
|
-
class ApplicationSerializer
|
4
|
-
include FastJsonapi::ObjectSerializer
|
5
|
-
|
6
|
-
def serializable_hash
|
7
|
-
data = super[:data]
|
8
|
-
if data.is_a? Hash
|
9
|
-
data[:attributes]
|
10
|
-
elsif data.is_a? Array
|
11
|
-
data.map { |d| d[:attributes] }
|
12
|
-
elsif data.nil?
|
13
|
-
nil
|
14
|
-
else
|
15
|
-
data
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|