dao-gateway-active_resource 1.3.1 → 1.3.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 104686c19906ff13265bab019b1a0762526990f5
|
4
|
+
data.tar.gz: 762d8fb55aa6f5bd35e5052262c52671ec567726
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef4678db605aadc408f364e17f1357743850ba3fcbc17b8b5e78257fba5837eb870527de9a68d9318335b309363c21176bf3924140ee1e691467fa826f08518a
|
7
|
+
data.tar.gz: 7423d0699427ada440b4d81fac2218d0a40381d6b2b2d1f8511c97a9e653492ae514700e406c609415b1a2ebd77ea503941c6191691eca298a69f2e9ed505338
|
@@ -20,10 +20,10 @@ module Dao
|
|
20
20
|
|
21
21
|
protected
|
22
22
|
|
23
|
-
def export(
|
24
|
-
return unless
|
25
|
-
record ||=
|
26
|
-
attributes =
|
23
|
+
def export(domain, record = nil)
|
24
|
+
return unless domain
|
25
|
+
record ||= empty_record(domain)
|
26
|
+
attributes = domain.attributes.except(*@black_list_attributes).stringify_keys
|
27
27
|
|
28
28
|
record.attributes = attributes
|
29
29
|
record
|
@@ -33,6 +33,10 @@ module Dao
|
|
33
33
|
relation.is_a?(::ActiveResource::Collection)
|
34
34
|
end
|
35
35
|
|
36
|
+
def empty_record(_domain)
|
37
|
+
source.new
|
38
|
+
end
|
39
|
+
|
36
40
|
def record(domain)
|
37
41
|
source.find(domain.id) if domain.id.present?
|
38
42
|
rescue ::ActiveResource::ResourceNotFound
|