simple_ams 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/simple_ams/adapters/jsonapi.rb +6 -6
- data/lib/simple_ams/document.rb +1 -4
- data/lib/simple_ams/dsl.rb +0 -1
- data/lib/simple_ams/version.rb +1 -1
- data/simple_ams.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e9a6bbc4ee5adfd199a3a3aa79ae6609e578e600e4ca1f93888efb2263f9b39
|
4
|
+
data.tar.gz: 3d25a70ad671b9ca9b57e229070dcb029d5368bc7f503335628fe761ee325a30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49f94ebf51efda1776abda3e7db9aa8a6a75b1ad25fe566a43a862e4bf4af6efc77c3d777138ba62c410d4be30ad5293eab0edf7eaf8729b775faff3ef0a1b84
|
7
|
+
data.tar.gz: 2a287e0f5d6b368f509a95f10777ff8e41bf57bcde11588ede23a0132d4fc1d8b4493c8aebb7e1292ac6ccd179bb737fd9c10c59ba78240ce68112a6887fdf20
|
@@ -47,12 +47,12 @@ class SimpleAMS::Adapters::JSONAPI
|
|
47
47
|
|
48
48
|
def transform_key(key)
|
49
49
|
case options[:key_transform]
|
50
|
-
|
51
|
-
|
52
|
-
when :
|
50
|
+
when :camel
|
51
|
+
key.to_s.split('_').map(&capitalize).join
|
52
|
+
when :kebab
|
53
53
|
key.to_s.gsub('_','-')
|
54
|
-
when :
|
55
|
-
key
|
54
|
+
when :snake
|
55
|
+
key
|
56
56
|
else
|
57
57
|
key
|
58
58
|
end
|
@@ -83,7 +83,7 @@ class SimpleAMS::Adapters::JSONAPI
|
|
83
83
|
return {} if relation.embedded.generics[:skip_data]&.value
|
84
84
|
|
85
85
|
if relation.folder?
|
86
|
-
value = relation.
|
86
|
+
value = relation.each.map{|doc|
|
87
87
|
{
|
88
88
|
doc.primary_id.name => doc.primary_id.value.to_s,
|
89
89
|
type: doc.type.name
|
data/lib/simple_ams/document.rb
CHANGED
@@ -103,10 +103,7 @@ class SimpleAMS::Document
|
|
103
103
|
|
104
104
|
#do we really need this method ?
|
105
105
|
def documents
|
106
|
-
|
107
|
-
#need optimization here!
|
108
|
-
SimpleAMS::Document.new(options_for(resource))
|
109
|
-
end
|
106
|
+
each.map
|
110
107
|
end
|
111
108
|
|
112
109
|
def resource_options
|
data/lib/simple_ams/dsl.rb
CHANGED
@@ -28,7 +28,6 @@ module SimpleAMS::DSL
|
|
28
28
|
module ClassMethods
|
29
29
|
#TODO: Shouldn't we call here super to presever user's behavior ?
|
30
30
|
def inherited(subclass)
|
31
|
-
#TODO: why this breaks collection type?
|
32
31
|
subclass.with_options(
|
33
32
|
options.merge(
|
34
33
|
#TODO: maybe add another group of elements under dsl?
|
data/lib/simple_ams/version.rb
CHANGED
data/simple_ams.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
21
|
spec.require_paths = ["lib"]
|
22
22
|
|
23
|
-
spec.add_development_dependency "bundler", "~>
|
23
|
+
spec.add_development_dependency "bundler", "~> 2.0.2"
|
24
24
|
spec.add_development_dependency "rake", "~> 10.0"
|
25
25
|
spec.add_development_dependency "rspec", "~> 3.0"
|
26
26
|
spec.add_development_dependency "faker", "~> 1.8.5"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_ams
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Filippos Vasilakis
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.0.2
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 2.0.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -159,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
159
159
|
- !ruby/object:Gem::Version
|
160
160
|
version: '0'
|
161
161
|
requirements: []
|
162
|
-
rubygems_version: 3.0.
|
162
|
+
rubygems_version: 3.0.3
|
163
163
|
signing_key:
|
164
164
|
specification_version: 4
|
165
165
|
summary: ActiveModel Serializers, simplified.
|