beaconable 0.2.2 → 0.2.3
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 +4 -4
- data/CHANGELOG.md +17 -0
- data/Gemfile.lock +12 -12
- data/lib/beaconable.rb +2 -1
- data/lib/beaconable/object_was.rb +1 -1
- data/lib/beaconable/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b1110a4b0e426b277132f84ad26662bd312339ed2442bf300943b9607983bea4
|
|
4
|
+
data.tar.gz: c15046bf2c149a9618057da5617dbe7e3aeda9e72506bf181b68bdb4d1486ee7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e0636144adbcb4f25a166fe5192617f07f8c0eb1ec22d8fb59abe4db8c2cd2fd9d195d920ad990989cc2914b779e2531aeeb7ec852e988e0506bd0b0e9b1f10b
|
|
7
|
+
data.tar.gz: 1fda0620bb1caaf045e6a017f607791cc412412edd8e2ae68bb3d0a3ac42d23a60f88dd1c2c171a0c2812508544c80a557de4639ebc908f8df64ee3661d4d45d
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
## 0.3.0 (2020-08-03)
|
|
2
|
+
|
|
3
|
+
- Changed ObjectWas initialization to wrap al all the changes for a transaction
|
|
4
|
+
|
|
5
|
+
## 0.2.2 (2019-12-16)
|
|
6
|
+
|
|
7
|
+
- Added new tests for chained methods
|
|
8
|
+
- Fixed chained methods
|
|
9
|
+
|
|
10
|
+
## 0.2.1 (2019-12-16)
|
|
11
|
+
|
|
12
|
+
- Made #field_change, #from and #to public
|
|
13
|
+
|
|
14
|
+
## 0.2.0 (2019-12-12)
|
|
15
|
+
|
|
16
|
+
- Added new test and fixes styles
|
|
17
|
+
- Added #field_change, #from, #to
|
data/Gemfile.lock
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
beaconable (0.2.
|
|
4
|
+
beaconable (0.2.3)
|
|
5
5
|
activerecord (>= 4.0)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
8
|
remote: https://rubygems.org/
|
|
9
9
|
specs:
|
|
10
|
-
activemodel (6.0.
|
|
11
|
-
activesupport (= 6.0.
|
|
12
|
-
activerecord (6.0.
|
|
13
|
-
activemodel (= 6.0.
|
|
14
|
-
activesupport (= 6.0.
|
|
15
|
-
activesupport (6.0.
|
|
10
|
+
activemodel (6.0.2)
|
|
11
|
+
activesupport (= 6.0.2)
|
|
12
|
+
activerecord (6.0.2)
|
|
13
|
+
activemodel (= 6.0.2)
|
|
14
|
+
activesupport (= 6.0.2)
|
|
15
|
+
activesupport (6.0.2)
|
|
16
16
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
17
17
|
i18n (>= 0.7, < 2)
|
|
18
18
|
minitest (~> 5.1)
|
|
19
19
|
tzinfo (~> 1.1)
|
|
20
|
-
zeitwerk (~> 2.
|
|
20
|
+
zeitwerk (~> 2.2)
|
|
21
21
|
ansi (1.5.0)
|
|
22
22
|
ast (2.4.0)
|
|
23
23
|
builder (3.2.3)
|
|
24
24
|
byebug (10.0.2)
|
|
25
|
-
concurrent-ruby (1.1.
|
|
26
|
-
i18n (1.
|
|
25
|
+
concurrent-ruby (1.1.6)
|
|
26
|
+
i18n (1.8.2)
|
|
27
27
|
concurrent-ruby (~> 1.0)
|
|
28
28
|
jaro_winkler (1.5.3)
|
|
29
29
|
minitest (5.11.3)
|
|
@@ -47,10 +47,10 @@ GEM
|
|
|
47
47
|
ruby-progressbar (1.10.1)
|
|
48
48
|
sqlite3 (1.4.1)
|
|
49
49
|
thread_safe (0.3.6)
|
|
50
|
-
tzinfo (1.2.
|
|
50
|
+
tzinfo (1.2.7)
|
|
51
51
|
thread_safe (~> 0.1)
|
|
52
52
|
unicode-display_width (1.6.0)
|
|
53
|
-
zeitwerk (2.
|
|
53
|
+
zeitwerk (2.2.2)
|
|
54
54
|
|
|
55
55
|
PLATFORMS
|
|
56
56
|
ruby
|
data/lib/beaconable.rb
CHANGED
|
@@ -15,12 +15,13 @@ module Beaconable
|
|
|
15
15
|
private
|
|
16
16
|
|
|
17
17
|
def save_for_beacon
|
|
18
|
-
@object_was
|
|
18
|
+
@object_was ||= ObjectWas.new(self).call
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
def fire_beacon
|
|
22
22
|
if self.saved_changes?
|
|
23
23
|
"#{self.class.name}Beacon".constantize.new(self, @object_was).call
|
|
24
24
|
end
|
|
25
|
+
@object_was = nil
|
|
25
26
|
end
|
|
26
27
|
end
|
|
@@ -10,7 +10,7 @@ module Beaconable
|
|
|
10
10
|
|
|
11
11
|
def call
|
|
12
12
|
hashed_object = {}
|
|
13
|
-
symbolized_column_names = object.class.column_names.map
|
|
13
|
+
symbolized_column_names = object.class.column_names.map(&:to_sym)
|
|
14
14
|
symbolized_column_names.each do |column_name|
|
|
15
15
|
hashed_object[column_name] = object.send("#{column_name}_was")
|
|
16
16
|
end
|
data/lib/beaconable/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: beaconable
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Gerardo Raiden
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2020-09-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activerecord
|
|
@@ -132,6 +132,7 @@ extra_rdoc_files: []
|
|
|
132
132
|
files:
|
|
133
133
|
- ".gitignore"
|
|
134
134
|
- ".travis.yml"
|
|
135
|
+
- CHANGELOG.md
|
|
135
136
|
- CODE_OF_CONDUCT.md
|
|
136
137
|
- Gemfile
|
|
137
138
|
- Gemfile.lock
|