tracker_jacker 1.0.0 → 2.0.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: 840c6c43cfb9f27c32cd7487eda3adcfb5ac2df5
4
- data.tar.gz: 6fd3f01466d48867e7d381bd16e0d18d986e2617
3
+ metadata.gz: c2578858aa22e44d15bc873a2c99dde956f63166
4
+ data.tar.gz: 3fdf6a1712d4ea38ef4eaec9bb1cca9a9d63296a
5
5
  SHA512:
6
- metadata.gz: 40e43e92d5b704a09668aa85a3bec30b7642a6c7899ade9fd9b22ae19a7fbf30c73610926c96869ecb7b7a06e4fc708ca246023da4baef181e4e107d42790159
7
- data.tar.gz: c38e3ec0bac64b2520ac131d1cc5b140d3b4dd6f65d3ec7d4e96dffdb64ae6cf19e0f5df7fd63708f1abbdc0650a261d7b266668e2318bd82d5720f8224d8432
6
+ metadata.gz: bd3a9f740167a862984b4dbe04992382d9da5257128e30ba617dc1c03421ea14da83f53310b5adc2fa202973563a5e767dce7f497c59bf7e2404d4ec448cab98
7
+ data.tar.gz: 0bd64aa597183db530f6d21eae7f3fa04b7e32674214edbbf84c0853767e9fd2ca2544f122ae9bf9094caf009eca6deb60b56dc5ac49b8fda0fb5a2c65e88507
data/Rakefile CHANGED
@@ -14,6 +14,9 @@ RDoc::Task.new(:rdoc) do |rdoc|
14
14
  rdoc.rdoc_files.include('lib/**/*.rb')
15
15
  end
16
16
 
17
+ require 'rspec/core/rake_task'
18
+ RSpec::Core::RakeTask.new
19
+ task default: :spec
17
20
 
18
21
 
19
22
 
@@ -45,15 +45,14 @@ module TrackerJacker
45
45
 
46
46
  object = self
47
47
  object.class.analytic_attribute_tracking_callbacks.values.each do |event_callback|
48
- dirty_method = event_callback.attribute.to_s + "_changed?"
49
- if object.public_send(dirty_method)
48
+ if object.saved_change_to_attribute?(event_callback.attribute)
50
49
  owner = object.public_send(event_callback.owner_method)
51
50
  TrackerJacker::TrackableEvent.create(
52
51
  category: event_callback.category,
53
52
  owner: owner,
54
53
  trackable: object,
55
54
  event: event_callback.attribute.to_s + "_changed",
56
- old_value: object.public_send(event_callback.attribute.to_s + "_was"),
55
+ old_value: attribute_before_last_save(event_callback.attribute),
57
56
  new_value: object.public_send(event_callback.attribute)
58
57
  )
59
58
  end
@@ -2,7 +2,7 @@ module TrackerJacker
2
2
  class TrackableEvent < ActiveRecord::Base
3
3
  belongs_to :trackable, polymorphic: true
4
4
  belongs_to :owner, polymorphic: true
5
-
5
+
6
6
  def week_created
7
7
  created_at.at_beginning_of_week
8
8
  end
@@ -1,3 +1,3 @@
1
1
  module TrackerJacker
2
- VERSION = "1.0.0"
2
+ VERSION = "2.0.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tracker_jacker
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Gesimondo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-01 00:00:00.000000000 Z
11
+ date: 2017-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 3.1.0
19
+ version: 5.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 3.1.0
26
+ version: 5.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sqlite3
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,14 +44,28 @@ dependencies:
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 2.14.0
47
+ version: 3.6.1
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 2.14.0
54
+ version: 3.6.1
55
+ - !ruby/object:Gem::Dependency
56
+ name: appraisal
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.0'
55
69
  description: Track events and ActiveRecord attribute changes in a timeline
56
70
  email:
57
71
  - john@jmondo.com
@@ -88,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
102
  version: '0'
89
103
  requirements: []
90
104
  rubyforge_project:
91
- rubygems_version: 2.4.5
105
+ rubygems_version: 2.6.13
92
106
  signing_key:
93
107
  specification_version: 4
94
108
  summary: Track events and ActiveRecord attribute changes