trogdir_models 0.11.7 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/trogdir/address.rb +11 -2
- data/lib/trogdir/email.rb +11 -2
- data/lib/trogdir/id.rb +10 -1
- data/lib/trogdir/phone.rb +11 -2
- data/lib/trogdir/photo.rb +10 -1
- data/lib/trogdir_models.rb +1 -0
- data/lib/trogdir_models/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0196e70c7924d230bb5fdfdbf4535fa98d3ea6f
|
4
|
+
data.tar.gz: e414e511e62e003ce13a3f6f4df12f2c1c43bd0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee38fb28bfd35af44859801570e8d43dcadeee48ee21ecda2b31727fcbdcb09e7f1bbc64aee2d13b0a2ab39736ba9606a95286978ad81c762dc6239328163a44
|
7
|
+
data.tar.gz: 5442e86d62cf227f3164efeef54a1f101f8395f2032992457aab5f0452668f4676e1b94cf21e878d447a1f37d3bca795f38e12ca7d4a90ca02ea1cb30866b4e0
|
data/lib/trogdir/address.rb
CHANGED
@@ -17,5 +17,14 @@ class Address
|
|
17
17
|
validates :type, presence: true, inclusion: { in: Address::TYPES }
|
18
18
|
validates :street_1, presence: true
|
19
19
|
|
20
|
-
track_history track_create: true, track_destroy: true
|
21
|
-
|
20
|
+
track_history changes_method: :track_type, track_create: true, track_destroy: true
|
21
|
+
|
22
|
+
private
|
23
|
+
def track_type
|
24
|
+
if changes.include? 'type'
|
25
|
+
changes
|
26
|
+
else
|
27
|
+
changes.merge("type" => [type, type])
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/lib/trogdir/email.rb
CHANGED
@@ -13,5 +13,14 @@ class Email
|
|
13
13
|
validates :type, presence: true, inclusion: { in: Email::TYPES }
|
14
14
|
validates :address, presence: true, email: true
|
15
15
|
|
16
|
-
track_history track_create: true, track_destroy: true
|
17
|
-
|
16
|
+
track_history changes_method: :track_type, track_create: true, track_destroy: true
|
17
|
+
|
18
|
+
private
|
19
|
+
def track_type
|
20
|
+
if changes.include? 'type'
|
21
|
+
changes
|
22
|
+
else
|
23
|
+
changes.merge("type" => [type, type])
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/trogdir/id.rb
CHANGED
@@ -18,9 +18,18 @@ class ID
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
track_history track_create: true, track_destroy: true
|
21
|
+
track_history changes_method: :track_type, track_create: true, track_destroy: true
|
22
22
|
|
23
23
|
def to_s
|
24
24
|
identifier
|
25
25
|
end
|
26
|
+
|
27
|
+
private
|
28
|
+
def track_type
|
29
|
+
if changes.include? 'type'
|
30
|
+
changes
|
31
|
+
else
|
32
|
+
changes.merge("type" => [type, type])
|
33
|
+
end
|
34
|
+
end
|
26
35
|
end
|
data/lib/trogdir/phone.rb
CHANGED
@@ -13,5 +13,14 @@ class Phone
|
|
13
13
|
validates :type, presence: true, inclusion: { in: Phone::TYPES }
|
14
14
|
validates :number, presence: true
|
15
15
|
|
16
|
-
track_history track_create: true, track_destroy: true
|
17
|
-
|
16
|
+
track_history changes_method: :track_type, track_create: true, track_destroy: true
|
17
|
+
|
18
|
+
private
|
19
|
+
def track_type
|
20
|
+
if changes.include? 'type'
|
21
|
+
changes
|
22
|
+
else
|
23
|
+
changes.merge("type" => [type, type])
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/trogdir/photo.rb
CHANGED
@@ -15,5 +15,14 @@ class Photo
|
|
15
15
|
validates :url, :height, :width, presence: true
|
16
16
|
validates :url, absolute_uri: true
|
17
17
|
|
18
|
-
track_history track_create: true, track_destroy: true
|
18
|
+
track_history changes_method: :track_type, track_create: true, track_destroy: true
|
19
|
+
|
20
|
+
private
|
21
|
+
def track_type
|
22
|
+
if changes.include? 'type'
|
23
|
+
changes
|
24
|
+
else
|
25
|
+
changes.merge("type" => [type, type])
|
26
|
+
end
|
27
|
+
end
|
19
28
|
end
|
data/lib/trogdir_models.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trogdir_models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Crownoble
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: api-auth
|
@@ -86,6 +86,20 @@ dependencies:
|
|
86
86
|
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: '0.4'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: request_store
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '1.1'
|
96
|
+
type: :runtime
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '1.1'
|
89
103
|
- !ruby/object:Gem::Dependency
|
90
104
|
name: factory_girl
|
91
105
|
requirement: !ruby/object:Gem::Requirement
|