historyable 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/historyable.rb +6 -6
- data/lib/historyable/version.rb +1 -1
- metadata +3 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NmJlMGExNTA0M2I4ZTQ5MWIzOWRkMzM1M2UwYTgwOWQ3NmY2MGE4Yg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OGNmYWIxNGFhYWQ5ZDVkMzBkOGUzOGRjOWNiM2ZkNjM0YzkwYWYwMg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MGMzZGZhYTJkNjMzM2I1ZDgwMTU4Y2NlOTY0YTdiNTBmZWRkYzg3NTFiNmNj
|
10
|
+
YWU2NTMzNjBhMzk1YTU2N2MyZWIwM2I5NzJhMTg2MWFmZmI1OTkzOTdlMzU0
|
11
|
+
NDlkNDEyNTUyNDhhOGQxZjhiMWY3NjBkYWNjOGVlMDM0NzJhZGE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Yjg1NjdhMDRlNzY5MTlhMmExZjkzMDQyNmU0ODAxM2NjMjgzNWRiNjZjMTli
|
14
|
+
OWUyZDAyNDIxOWRjZGQzMDlkNWVjYjk2OTFkZmU5YTJiYjdkMzU5NDk5ZjU3
|
15
|
+
ZjdhN2U0NjUxODZiYmJkMTcxMGQzOTA2OTlmOGJiNmU1YTNhZmQ=
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/historyable.rb
CHANGED
@@ -8,6 +8,8 @@ module Historyable
|
|
8
8
|
|
9
9
|
Item = Struct.new(:attribute_name, :association_name)
|
10
10
|
|
11
|
+
Entry = Struct.new(:attribute_value, :changed_at)
|
12
|
+
|
11
13
|
included do
|
12
14
|
class_attribute :historyable_items, instance_writer: false
|
13
15
|
attr_accessor :historyable_cache
|
@@ -79,13 +81,11 @@ module Historyable
|
|
79
81
|
define_method("#{historyable.attribute_name.to_s}_history") do
|
80
82
|
self.historyable_cache ||= Hash.new
|
81
83
|
historyable_cache[historyable.attribute_name] ||= send("#{historyable.attribute_name}_history_raw").inject([]) do |memo, record|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
item[:attribute_value] = record.object_attribute_value
|
86
|
-
item[:changed_at] = record.created_at
|
84
|
+
entry = Entry.new
|
85
|
+
entry.attribute_value = record.object_attribute_value
|
86
|
+
entry.changed_at = record.created_at
|
87
87
|
|
88
|
-
memo <<
|
88
|
+
memo << entry
|
89
89
|
end
|
90
90
|
end
|
91
91
|
end
|
data/lib/historyable/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: historyable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Philippe Dionne
|
@@ -38,7 +38,7 @@ cert_chain:
|
|
38
38
|
aW9OckllMC8xNWRIcERvSUVESUxhNnpVNDZCClhEdHAxWXhkZVZHSUJ1Tm9Q
|
39
39
|
MXZqRFN2TktZajBwTWpSQUVQcnFLMzlqS0U9Ci0tLS0tRU5EIENFUlRJRklD
|
40
40
|
QVRFLS0tLS0K
|
41
|
-
date: 2013-
|
41
|
+
date: 2013-10-18 00:00:00.000000000 Z
|
42
42
|
dependencies:
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
87
87
|
version: '0'
|
88
88
|
requirements: []
|
89
89
|
rubyforge_project:
|
90
|
-
rubygems_version: 2.1.
|
90
|
+
rubygems_version: 2.1.5
|
91
91
|
signing_key:
|
92
92
|
specification_version: 4
|
93
93
|
summary: A simple and solid concern to track ActiveRecord models attributes changes.
|
metadata.gz.sig
CHANGED
Binary file
|