scoped_serializer 1.0.0.b → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/scoped_serializer.rb +2 -0
- data/lib/scoped_serializer/base_serializer.rb +7 -1
- data/lib/scoped_serializer/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bac41027d295a52498d1966920f57e030b78c547
|
4
|
+
data.tar.gz: e497b8660c9951ea614f2b8c97d2692b92977bc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed509d7a7c1e4fc986da5420865be2386724ed6ee3643c9c0e4c3c76502e99c49c1c7e87bee3a672d0eb1e18fface9be124a41d2fde1f799dbb716df16747b19
|
7
|
+
data.tar.gz: 82f0ea3dcf619cb739f93bff8d8385459563b32b705769bc8e18f472b915a55e5eaf32f24bff6d347cf86a5dc77c6816251c4f02ae59795bb9e87fb191f9eeb6
|
data/lib/scoped_serializer.rb
CHANGED
@@ -23,7 +23,13 @@ module ScopedSerializer
|
|
23
23
|
# default_root_key(User) # => 'user'
|
24
24
|
#
|
25
25
|
def default_root_key(object_class)
|
26
|
-
if
|
26
|
+
if (serializer = ScopedSerializer.find_serializer_by_class(object_class))
|
27
|
+
root_key = serializer.find_scope(:default).options[:root]
|
28
|
+
end
|
29
|
+
|
30
|
+
if root_key
|
31
|
+
root_key.to_s
|
32
|
+
elsif object_class.respond_to?(:model_name)
|
27
33
|
object_class.model_name.element
|
28
34
|
else
|
29
35
|
object_class.name
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scoped_serializer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arjen Oosterkamp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -184,9 +184,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
184
184
|
version: '0'
|
185
185
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
186
186
|
requirements:
|
187
|
-
- - "
|
187
|
+
- - ">="
|
188
188
|
- !ruby/object:Gem::Version
|
189
|
-
version:
|
189
|
+
version: '0'
|
190
190
|
requirements: []
|
191
191
|
rubyforge_project:
|
192
192
|
rubygems_version: 2.4.5
|