unidom-certificate 1.3 → 2.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9e22aa3d53f16ed7862b6d9219d08810b4dad2c
|
4
|
+
data.tar.gz: 0870c1537388fd0124b43c3588bdc19ad09d8aa2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a31d2ec93c6d40cf269ffd2bd60c2433ca489ad081c9bd17064d34eb35f794494e7a3a7a0e76105cd8df7bcebac5700198f112ec2f49d3fb7bb1bcacbd12ff59
|
7
|
+
data.tar.gz: 0109140f011ba15799f7503ce60bdef6edea247f7a35563477b7507ae3bf917c87b2a7110514021a6f9a28f84cc06032a51a05edc4ef9a7164d5ee8cc88caf9d
|
@@ -14,9 +14,9 @@ class Unidom::Certificate::Certificating < ActiveRecord::Base
|
|
14
14
|
scope :certificated_is, ->(certificated) { where certificated: certificated }
|
15
15
|
scope :certification_is, ->(certification) { where certification: certification }
|
16
16
|
|
17
|
-
def self.certificate(certification: nil, certificated: nil, certificator: nil, opened_at: Time.now)
|
18
|
-
|
19
|
-
end
|
17
|
+
#def self.certificate(certification: nil, certificated: nil, certificator: nil, opened_at: Time.now)
|
18
|
+
# certificate! certification: certification, certificated: certificated, certificator: certificator, opened_at: opened_at
|
19
|
+
#end
|
20
20
|
|
21
21
|
def self.certificate!(certification: nil, certificated: nil, certificator: nil, opened_at: Time.now)
|
22
22
|
raise ArgumentError.new('The certification argument is required.') if certification.blank?
|
@@ -30,11 +30,11 @@ class Unidom::Certificate::Certificating < ActiveRecord::Base
|
|
30
30
|
attributes[:certificator_id] = Unidom::Common::NULL_UUID
|
31
31
|
attributes[:certificator_type] = ''
|
32
32
|
end
|
33
|
-
self.certification_is(certification).certificated_is(certificated).valid_at.alive.first_or_create! attributes
|
33
|
+
self.certification_is(certification).certificated_is(certificated).valid_at(now: opened_at).alive.first_or_create! attributes
|
34
34
|
end
|
35
35
|
|
36
|
-
class << self
|
37
|
-
|
38
|
-
end
|
36
|
+
#class << self
|
37
|
+
# deprecate certificate: :certificate!, deprecator: ActiveSupport::Deprecation.new('2.0', 'unidom-certificate')
|
38
|
+
#end
|
39
39
|
|
40
40
|
end
|
@@ -12,7 +12,7 @@ module Unidom::Certificate::Concerns::AsCertificated
|
|
12
12
|
raise ArgumentError.new('The by argument is required.' ) if by.blank?
|
13
13
|
raise ArgumentError.new('The at argument is required.' ) if at.blank?
|
14
14
|
|
15
|
-
certificatings.
|
15
|
+
certificatings.certification_is(certification).valid_at(now: at).alive.first_or_create! certificator: by, opened_at: at
|
16
16
|
|
17
17
|
end
|
18
18
|
|
@@ -12,7 +12,8 @@ module Unidom::Certificate::Concerns::AsCertification
|
|
12
12
|
raise ArgumentError.new('The by argument is required.' ) if by.blank?
|
13
13
|
raise ArgumentError.new('The at argument is required.' ) if at.blank?
|
14
14
|
|
15
|
-
certificatings.
|
15
|
+
certificatings.certificated_is(certificated).valid_at(now: at).alive.first_or_create! certificator: by, opened_at: at
|
16
|
+
|
16
17
|
end
|
17
18
|
|
18
19
|
def certificate?(certificated, at: Time.now)
|
@@ -21,6 +22,7 @@ module Unidom::Certificate::Concerns::AsCertification
|
|
21
22
|
raise ArgumentError.new('The at argument is required.' ) if at.blank?
|
22
23
|
|
23
24
|
certificatings.certificated_is(certificated).valid_at(now: at).alive.exists?
|
25
|
+
|
24
26
|
end
|
25
27
|
|
26
28
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unidom-certificate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '
|
4
|
+
version: '2.0'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Topbit Du
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-common
|