version_serializers 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/version_serializers/base.rb +2 -1
- data/lib/version_serializers/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e73b442e85a5f2b7970e4bfd427beae7fa131be1
|
4
|
+
data.tar.gz: 5184c3ff3a81e67778e9b1f15b1fb56a8f2a564b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0efc55afeadaca8ccbdf11b79c18b0985fbb47c188cc64688c1f6b6086784e2d30adaa26d5bc81588f775a43d72e0f706096047efea8146f490571e8c92c7fb
|
7
|
+
data.tar.gz: e0483bee663dc4ee9558cf6ab5c6dad867ecc46d67ceaf9fe2c65f9d9bc51d66a7723cd0f3b69d9afc5cd83fcf50b3353faad5f4d653c2af06c1a310c2415ffd
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
class VersionSerializer::Base < ActiveModel::Serializer
|
2
2
|
[:belongs_to, :has_one, :has_many].each do |meth|
|
3
3
|
define_singleton_method(meth) do |resource, opts = {}|
|
4
|
+
serializer_name = opts.fetch(:class_name) { resource.to_s.singularize }
|
4
5
|
opts.merge!(
|
5
|
-
serializer: VersionSerializer::Versioner.get_serializer(
|
6
|
+
serializer: VersionSerializer::Versioner.get_serializer(serializer_name, name.deconstantize[1])
|
6
7
|
)
|
7
8
|
super(resource, opts)
|
8
9
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: version_serializers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben D'Angelo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_model_serializers
|