json_api_resource 3.1.3 → 3.1.4

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: 502e00131cffdcee41b210d599619ff563c31eb7
4
- data.tar.gz: 1e119324e7c37190565abaa2c2a240191e46a8a1
3
+ metadata.gz: f7e858ea2abf0dc3d70196d921ddc8f3796829d6
4
+ data.tar.gz: '098c0d3aa4e6d1421932099a25f1a24b5b60207d'
5
5
  SHA512:
6
- metadata.gz: 0646c141ba8f767cdf7bfe6b11e17d2de345f3e425424cd99792414f1b89fefdbc1cdde9735c236c67f9ee224a22242cbce8865f57bc04ed9c7cb0b331450c48
7
- data.tar.gz: c3805f133c008922a34b16a90452cfe3ad28017ca7a97810883c2fec062f8609a405f8a4d92480ba848ebc4f3fd11b651f9451555d540b4bf15a5c75c5fdb27d
6
+ metadata.gz: 67080ff9381a2d9c6efb3198377dba526411ef24fde005f9e3577987b9ac20bccd0604c9e196fb04d3e623850175ac8accae5819963308dd28141817bf3b0576
7
+ data.tar.gz: 354fecb7027c2fd4c55becb74e22194f4a42d2ecfbe15cdd0e37dd21690251bd8fdf1e7a4f80b3b1ef9b3a1c2fae6623a6c6dc35344e9d3df697dd5be1e455ae
data/README.md CHANGED
@@ -170,6 +170,9 @@ class Service::Client::Superuser < Service::Client::Base
170
170
  custom_endpoint :superuser_from_user_id, :on=> :collection, :request_method=> :get
171
171
  end
172
172
 
173
+ * 'class' - specifies the class for the association
174
+ * 'class_name' - a string that specifies a class for the association. Handy for load order issues
175
+
173
176
  class User
174
177
  wraps Service::Client::User
175
178
  has_one :superuser, action: :superuser_from_user_id
@@ -34,7 +34,10 @@ module JsonApiResource
34
34
 
35
35
  # klass has to be lazy initted for circular dependencies
36
36
  def klass
37
- @klass ||= @opts.delete :class do derived_class end
37
+ @klass ||= begin
38
+ klass = @opts.delete(:class_name).try :constantize
39
+ klass || @opts.delete( :class ) do derived_class end
40
+ end
38
41
  end
39
42
 
40
43
  def post_process( value )
@@ -64,7 +67,7 @@ module JsonApiResource
64
67
  class_string.constantize
65
68
  end
66
69
 
67
- ASSOCIATION_OPTS = [:class, :action, :foreign_key, :prefetched_ids]
70
+ ASSOCIATION_OPTS = [:class, :action, :foreign_key, :prefetched_ids, :class_name]
68
71
 
69
72
  RESERVED_KEYWORDS = [:attributes, :_associations, :_cached_associations, :schema, :client]
70
73
 
@@ -1,3 +1,3 @@
1
1
  module JsonApiResource
2
- VERSION = "3.1.3"
2
+ VERSION = "3.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_api_resource
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.3
4
+ version: 3.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Sislow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-02 00:00:00.000000000 Z
11
+ date: 2016-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json_api_client
@@ -163,3 +163,4 @@ signing_key:
163
163
  specification_version: 4
164
164
  summary: Build wrapper/adapter objects around JsonApiClient instances
165
165
  test_files: []
166
+ has_rdoc: