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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2c940130b860e29fd8134f62164b096775aedf18
4
- data.tar.gz: 65ce7e6716aa92daa54fc1cd7801902b2db5a7be
3
+ metadata.gz: d0196e70c7924d230bb5fdfdbf4535fa98d3ea6f
4
+ data.tar.gz: e414e511e62e003ce13a3f6f4df12f2c1c43bd0b
5
5
  SHA512:
6
- metadata.gz: 0bc80199f2d63ad57f150cdf345d459e91d73052dcb354f6cad7ef2d371a1e0a9565799be6de59f0ea8fc3693321ecb8eb4d1c62dca43163ba4fb6561e235919
7
- data.tar.gz: a1c3eb1be8c7ab4f77b3646a9d9930895a4748b932881eaf77611273b9b10421af681146717111c0c8db17b10b4cd905df40ba55540332cfb2e257b808af201a
6
+ metadata.gz: ee38fb28bfd35af44859801570e8d43dcadeee48ee21ecda2b31727fcbdcb09e7f1bbc64aee2d13b0a2ab39736ba9606a95286978ad81c762dc6239328163a44
7
+ data.tar.gz: 5442e86d62cf227f3164efeef54a1f101f8395f2032992457aab5f0452668f4676e1b94cf21e878d447a1f37d3bca795f38e12ca7d4a90ca02ea1cb30866b4e0
@@ -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
- end
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
@@ -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
- end
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
@@ -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
@@ -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
- end
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
@@ -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
@@ -7,6 +7,7 @@ end
7
7
 
8
8
  # Models
9
9
  require 'mongoid'
10
+ require 'request_store'
10
11
  require 'mongoid_userstamp'
11
12
  autoload :Person, 'trogdir/person'
12
13
  autoload :ID, 'trogdir/id'
@@ -1,3 +1,3 @@
1
1
  module TrogdirModels
2
- VERSION = '0.11.7'
2
+ VERSION = '0.12.0'
3
3
  end
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.11.7
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-04-14 00:00:00.000000000 Z
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