contacts_client 0.0.19 → 0.0.20
Sign up to get free protection for your applications and to get access to all the features.
- data/app/models/padma_contact.rb +16 -0
- metadata +1 -1
data/app/models/padma_contact.rb
CHANGED
@@ -239,4 +239,20 @@ class PadmaContact < LogicalModel
|
|
239
239
|
end
|
240
240
|
end
|
241
241
|
|
242
|
+
def self.find_by_kshema_id(kshema_id)
|
243
|
+
params = { kshema_id: kshema_id}
|
244
|
+
params = self.merge_key(params)
|
245
|
+
|
246
|
+
response = Typhoeus::Request.get(self.resource_uri+'/by_kshema_id', params: params)
|
247
|
+
if response.success?
|
248
|
+
unless response.body == 'null'
|
249
|
+
self.new.from_json(response.body)
|
250
|
+
else
|
251
|
+
return nil
|
252
|
+
end
|
253
|
+
else
|
254
|
+
return nil
|
255
|
+
end
|
256
|
+
end
|
257
|
+
|
242
258
|
end
|