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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8bbb4cb94fc0edc38cfe1610f3c61e7b6fab6de5
4
- data.tar.gz: 9d9ab9059014e7e520308694aa04f34859250850
3
+ metadata.gz: e73b442e85a5f2b7970e4bfd427beae7fa131be1
4
+ data.tar.gz: 5184c3ff3a81e67778e9b1f15b1fb56a8f2a564b
5
5
  SHA512:
6
- metadata.gz: 45f7db941efddda57c851f93861c4ab21ba85355fefcce804ed245162ac71eb711da3726dc2e37ae357dce26668b3d60cccaea072739d85a5e2fa92588f01112
7
- data.tar.gz: a2a2c10aa3a80022a68d2c579027003f7ff5f81072c4c115864671f2f65e02a33514d1a0fbcd61f38469b5aabfa51f5aec53b20b5994d0ae7bc7c84ddd84df0c
6
+ metadata.gz: a0efc55afeadaca8ccbdf11b79c18b0985fbb47c188cc64688c1f6b6086784e2d30adaa26d5bc81588f775a43d72e0f706096047efea8146f490571e8c92c7fb
7
+ data.tar.gz: e0483bee663dc4ee9558cf6ab5c6dad867ecc46d67ceaf9fe2c65f9d9bc51d66a7723cd0f3b69d9afc5cd83fcf50b3353faad5f4d653c2af06c1a310c2415ffd
data/Gemfile.lock CHANGED
@@ -85,7 +85,7 @@ GIT
85
85
  PATH
86
86
  remote: .
87
87
  specs:
88
- version_serializers (0.1.1)
88
+ version_serializers (0.1.2)
89
89
  active_model_serializers (= 0.10.0.rc2)
90
90
 
91
91
  GEM
@@ -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(resource.to_s.singularize, name.deconstantize[1])
6
+ serializer: VersionSerializer::Versioner.get_serializer(serializer_name, name.deconstantize[1])
6
7
  )
7
8
  super(resource, opts)
8
9
  end
@@ -1,3 +1,3 @@
1
1
  module VersionSerializer
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  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.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-13 00:00:00.000000000 Z
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