unimatrix 1.4.1 → 1.4.3

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: d53a593c457bab904685c35dd94420773aa254a8
4
- data.tar.gz: 4b7f87ff0a292a5f50d0015b14d5427f0fd965cf
3
+ metadata.gz: f1e68de8a76b4c46e57bb9a3adb384ad30e45b4f
4
+ data.tar.gz: deec411e07b156ed1ee89866df7b565e8a0959df
5
5
  SHA512:
6
- metadata.gz: 0a5658f3568754e9ba348378f3d1b54f2f0fa9bae27aa8ea5e567553f3efa05dd4dcbfdd1de4c139fcbaf3d31d08770a526843d5924021ba495cdee959d719b8
7
- data.tar.gz: afa67d355baf54e7dedb512c0a2e6110435d165626b2a8ba621c35970a07fc3228b7300d9bf403ee09818e47860bf77600a09587e9d153746999fc58a5b263ae
6
+ metadata.gz: a6f1306a188e70865219df2a12d3518ea28f655b1c697997add111c20322fb5d5349bedabe1f1fcf20c706e703f56d99c4bdeb7dce1ed657ab39b5b5e16e9c63
7
+ data.tar.gz: 8118a8d7dacd4b0563fde96f2ec335b50c07b56af7bda259c017a057d26f50fe40fc9e75d9d0e60f4cb2129aae6c49010686fc123b9f59635911a4f2431c3bfb
@@ -99,10 +99,11 @@ module Unimatrix
99
99
  if resource_attributes.present?
100
100
  parse_nested_attributes( resource_attributes )
101
101
 
102
- resource_type_name = options[ 'type_name' ] ||
103
- resource_attributes[ 'type_name' ]
102
+ resource_class = find_resource_class_by_type_name(
103
+ resource_attributes[ 'type_name' ],
104
+ options[ 'type_name' ]
105
+ )
104
106
 
105
- resource_class = Resource.find_by_type_name( resource_type_name )
106
107
  if resource_class.present?
107
108
  result = resource_class.new(
108
109
  resource_attributes,
@@ -120,6 +121,13 @@ module Unimatrix
120
121
 
121
122
  end
122
123
 
124
+ def find_resource_class_by_type_name( attribute_type_name, option_type_name )
125
+ resource_class = Resource.find_by_type_name( attribute_type_name )
126
+ unless resource_class.present?
127
+ resource_class = Resource.find_by_type_name( option_type_name )
128
+ end
129
+ end
130
+
123
131
  def resource_associations_by( name, key )
124
132
  result = Hash.new { | hash, key | hash[ key ] = [] }
125
133
  associations = self.associations
@@ -1,3 +1,3 @@
1
1
  module Unimatrix
2
- VERSION = "1.4.1"
2
+ VERSION = "1.4.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unimatrix
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jackson Souza
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-30 00:00:00.000000000 Z
11
+ date: 2018-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -170,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
170
170
  version: '0'
171
171
  requirements: []
172
172
  rubyforge_project:
173
- rubygems_version: 2.6.12
173
+ rubygems_version: 2.5.2
174
174
  signing_key:
175
175
  specification_version: 4
176
176
  summary: Unimatrix is used to communicate with Unimatrix APIs.