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: dda7436bbe4458f7126e3897a4559e2e08edb40a
4
- data.tar.gz: 11993d222c2b2a94f2908ca664fc7055f49a1fb1
3
+ metadata.gz: 104686c19906ff13265bab019b1a0762526990f5
4
+ data.tar.gz: 762d8fb55aa6f5bd35e5052262c52671ec567726
5
5
  SHA512:
6
- metadata.gz: c8f55f20abe17d58bb300877eff9b86e32ec539bc56b6ead51614b501a3442f05c9a0dce1d0d4bfa028e54c5ea26da20fa48f556850e7a76fcdbba860b8e16dd
7
- data.tar.gz: 25e7a4a184c6f8f1d0eb1fc80304cc0ddd769c11f6d6f18ef12cceefc3baec8d15f869029e6f047607fed8e1e7082c20311c9a93d53c555d996c412db664a2d3
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(base, record = nil)
24
- return unless base
25
- record ||= source.new
26
- attributes = base.attributes.except(*@black_list_attributes).stringify_keys
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
@@ -1,7 +1,7 @@
1
1
  module Dao
2
2
  module Gateway
3
3
  module ActiveResource
4
- VERSION = '1.3.1'
4
+ VERSION = '1.3.2'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dao-gateway-active_resource
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - llxff