normalizr_ruby 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ad4f4f6adc8e503d8fca73d97b300924fb13b19a
4
- data.tar.gz: 5e5260114c387d049b7375aadc4e8fc6b8d57f17
3
+ metadata.gz: a9776c9f983df19c4e592d470d9447afc908bc29
4
+ data.tar.gz: 0998cbfe62dd88e856914a366de8aed0509c6729
5
5
  SHA512:
6
- metadata.gz: f5790d6d59dbe7bb08ee27c6985748521cc58fd8b639fb12c6c10eb63739264a7b2176eb757541b8ddbe2d722d276daed64ceb7a43760206bd36803a30599d64
7
- data.tar.gz: 4d88c5d43d4e2789aeea86dec7dbf3291f0095a94e41c9634c98c0a1ace337a9e0fd9c50282aeb72218a55b13036135c80ef79f1872d609686a50cbae8c18256
6
+ metadata.gz: 6f49d83f93e6da7e0bba8a95c631108cf3d5b36b5758fc6c6101b703e27792eeea88ca07dc20e76ee41c4c48f86288433ce930fa6976ecb768fee756d4bb3697
7
+ data.tar.gz: 756aa78c442b552287a9f31043f8476f9da362ce8c9d2d51c2497e8cbe696fe782fd7693141e23c711681dc318ffbf947fe38b1f2e751baf31d299d166cde27e
data/README.md CHANGED
@@ -1,7 +1,8 @@
1
1
  # NormalizrRuby
2
+ [![Gem Version](https://badge.fury.io/rb/normalizr_ruby.svg)](https://badge.fury.io/rb/normalizr_ruby)
2
3
  [![Build Status](https://travis-ci.org/oreshinya/normalizr_ruby.svg?branch=master)](https://travis-ci.org/oreshinya/normalizr_ruby)
3
4
 
4
- [Normalizr](https://github.com/paularmstrong/normalizr) format JSON generator.
5
+ [Normalizr](https://github.com/paularmstrong/normalizr) format JSON generator for API server.
5
6
 
6
7
  ## Installation
7
8
 
@@ -3,7 +3,7 @@ module NormalizrRuby
3
3
  class SchemaNotFound < StandardError; end
4
4
 
5
5
  def self.get_schema_class(resource)
6
- resource_class_name = resource.class.name
6
+ resource_class_name = resource.class.base_class.name
7
7
  schema_class = "#{resource_class_name}Schema".safe_constantize
8
8
  if schema_class.nil?
9
9
  raise SchemaNotFound, "#{resource_class_name} is not found."
@@ -35,7 +35,7 @@ module NormalizrRuby
35
35
  schema_class = options[:schema].presence || self.class.get_schema_class(resource)
36
36
  schema = schema_class.new(resource, @context, options.except(:schema))
37
37
  result = schema.object.id
38
- entity_key = schema.object.class.name.pluralize.to_sym
38
+ entity_key = schema.object.class.base_class.name.pluralize.to_sym
39
39
  hash = schema.attributes
40
40
  schema.associations.each do |association, assoc_options|
41
41
  association_result = walk(schema.object.send(association), assoc_options)
@@ -1,3 +1,3 @@
1
1
  module NormalizrRuby
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: normalizr_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - shinya takahashi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-24 00:00:00.000000000 Z
11
+ date: 2016-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport