notifiably_audited 0.0.7 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/.gitignore +7 -13
- data/.travis.yml +10 -0
- data/.yardopts +3 -0
- data/audited-activerecord.gemspec +2 -1
- data/audited.gemspec +1 -2
- data/lib/{audited → notifiably_audited}/audit.rb +1 -1
- data/lib/{audited → notifiably_audited}/auditor.rb +11 -11
- data/lib/{audited → notifiably_audited}/rspec_matchers.rb +0 -0
- data/lib/{audited → notifiably_audited}/sweeper.rb +6 -6
- data/lib/notifiably_audited-activerecord.rb +2 -0
- data/lib/notifiably_audited.rb +1 -1
- data/notifiably_audited-0.1.0.gem +0 -0
- data/notifiably_audited-0.1.1.gem +0 -0
- data/notifiably_audited-0.1.2.gem +0 -0
- data/notifiably_audited-0.1.3.gem +0 -0
- data/notifiably_audited-0.1.4.gem +0 -0
- data/notifiably_audited-0.1.5.gem +0 -0
- data/notifiably_audited-0.1.6.gem +0 -0
- data/notifiably_audited-0.1.7.gem +0 -0
- data/notifiably_audited-0.1.8.gem +0 -0
- data/notifiably_audited-0.1.9.gem +0 -0
- data/notifiably_audited-activerecord-0.1.0.gem +0 -0
- data/notifiably_audited-activerecord-0.1.1.gem +0 -0
- data/notifiably_audited-activerecord-0.1.2.gem +0 -0
- data/notifiably_audited-activerecord-0.1.3.gem +0 -0
- data/notifiably_audited-activerecord-0.1.4.gem +0 -0
- data/notifiably_audited-activerecord-0.1.5.gem +0 -0
- data/notifiably_audited-activerecord-0.1.6.gem +0 -0
- data/notifiably_audited-activerecord-0.1.8.gem +0 -0
- data/notifiably_audited-activerecord-0.1.9.gem +0 -0
- metadata +27 -23
- data/LICENSE.txt +0 -22
- data/lib/audited.rb +0 -15
- data/lib/notifiably_audited/version.rb +0 -3
- data/notifiably_audited.gemspec +0 -23
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OGEzNTkwZmYwY2U2MWYxM2I2NjNiNzAwMjM1Mjc4NTRjYTU4YmQ3Mw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MTQ2M2Y4MzI5NzBiOTE3MjM4N2E5MWVjNGYzYjk4YjA1NjhlZWQ3NA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OGI2N2E2MzI3MDYxMTA5NTlkZmQwYjkyMTk3MmQxZDkzZTdhYWM0YTUxNDVm
|
10
|
+
MjM1YTVkNDFkMTkyNDExZDgzNWYwZWFlN2FhZmFmZjIyZTMxYjk5YzJlNTYx
|
11
|
+
YWQ0N2M0NDkxM2QzNzIwOWM5ZTMxNDNkYmJlZTk0NjZjM2FjOTA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZTNjMWVhMmI4ZmQ4MDIwMjExMzE3ZGMyNzE4NWZhMjA1YWM1NjE1MWEwMjZh
|
14
|
+
ZDgzOWYyYmE3ODMyMmJmMzBkZmM3ODhhZDdlODI0ZWI4NTUxYWM4NzdjY2Zl
|
15
|
+
NDkwMjE2YjNiYWVmM2JlMzNkZWNlZmVhOGZhZDNlNjYxMjhkYjY=
|
data/.gitignore
CHANGED
@@ -1,17 +1,11 @@
|
|
1
|
-
*.
|
2
|
-
*.
|
1
|
+
*.log
|
2
|
+
*.swp
|
3
3
|
.bundle
|
4
|
-
.
|
4
|
+
.rvmrc
|
5
5
|
.yardoc
|
6
|
-
|
7
|
-
InstalledFiles
|
8
|
-
_yardoc
|
9
|
-
coverage
|
6
|
+
coverage/
|
10
7
|
doc/
|
11
|
-
|
8
|
+
Gemfile.lock
|
9
|
+
gemfiles/*.lock
|
12
10
|
pkg
|
13
|
-
|
14
|
-
spec/reports
|
15
|
-
test/tmp
|
16
|
-
test/version_tmp
|
17
|
-
tmp
|
11
|
+
tmp/*
|
data/.travis.yml
ADDED
data/.yardopts
ADDED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |gem|
|
4
4
|
gem.name = 'notifiably_audited-activerecord'
|
5
|
-
gem.version = '0.
|
5
|
+
gem.version = '0.1.11'
|
6
6
|
|
7
7
|
gem.authors = ['senthil kumar']
|
8
8
|
gem.email = 'senthilkumar.hce@gmail.com'
|
@@ -11,6 +11,7 @@ Gem::Specification.new do |gem|
|
|
11
11
|
gem.homepage = ''
|
12
12
|
gem.license = 'MIT'
|
13
13
|
|
14
|
+
|
14
15
|
gem.add_dependency 'notifiably_audited', gem.version
|
15
16
|
gem.add_dependency 'activerecord', '~> 3.0'
|
16
17
|
|
data/audited.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |gem|
|
4
4
|
gem.name = 'notifiably_audited'
|
5
|
-
gem.version = '0.
|
5
|
+
gem.version = '0.1.11'
|
6
6
|
|
7
7
|
gem.authors = ['senthil kumar']
|
8
8
|
gem.email = 'senthilkumar.hce@gmail.com'
|
@@ -18,7 +18,6 @@ Gem::Specification.new do |gem|
|
|
18
18
|
gem.add_development_dependency 'rails', '~> 3.0'
|
19
19
|
gem.add_development_dependency 'rspec-rails', '~> 2.0'
|
20
20
|
gem.add_development_dependency 'sqlite3', '~> 1.0'
|
21
|
-
gem.add_development_dependency 'private_pub'
|
22
21
|
|
23
22
|
gem.files = `git ls-files`.split($\).reject{|f| f =~ /(lib\/audited\-|adapters|generators)/ }
|
24
23
|
gem.test_files = gem.files.grep(/^spec\//)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module NotifiablyAudited
|
2
2
|
# Specify this act if you want changes to your model to be saved in an
|
3
3
|
# audit table. This assumes there is an audits table ready.
|
4
4
|
#
|
@@ -45,7 +45,7 @@ module Audited
|
|
45
45
|
#
|
46
46
|
def notifiably_audited(options = {})
|
47
47
|
# don't allow multiple calls
|
48
|
-
return if self.included_modules.include?(
|
48
|
+
return if self.included_modules.include?(NotifiablyAudited::Auditor::AuditedInstanceMethods)
|
49
49
|
|
50
50
|
class_attribute :non_audited_columns, :instance_writer => false
|
51
51
|
class_attribute :auditing_enabled, :instance_writer => false
|
@@ -62,7 +62,7 @@ module Audited
|
|
62
62
|
if options[:only]
|
63
63
|
except = self.column_names - options[:only].flatten.map(&:to_s)
|
64
64
|
else
|
65
|
-
except = default_ignored_attributes +
|
65
|
+
except = default_ignored_attributes + NotifiablyAudited.ignored_attributes
|
66
66
|
except |= Array(options[:except]).collect(&:to_s) if options[:except]
|
67
67
|
end
|
68
68
|
self.non_audited_columns = except
|
@@ -87,7 +87,7 @@ module Audited
|
|
87
87
|
end
|
88
88
|
|
89
89
|
has_many :audits, :as => :auditable, :class_name => Audited.audit_class.name
|
90
|
-
|
90
|
+
NotifiablyAudited.audit_class.audited_class_names << self.to_s
|
91
91
|
|
92
92
|
after_create :audit_create if !options[:on] || (options[:on] && options[:on].include?(:create))
|
93
93
|
before_update :audit_update if !options[:on] || (options[:on] && options[:on].include?(:update))
|
@@ -100,15 +100,15 @@ module Audited
|
|
100
100
|
|
101
101
|
attr_accessor :version
|
102
102
|
|
103
|
-
extend
|
104
|
-
include
|
103
|
+
extend NotifiablyAudited::Auditor::AuditedClassMethods
|
104
|
+
include NotifiablyAudited::Auditor::AuditedInstanceMethods
|
105
105
|
|
106
106
|
self.auditing_enabled = true
|
107
107
|
|
108
108
|
end
|
109
109
|
|
110
110
|
def has_associated_audits
|
111
|
-
has_many :associated_audits
|
111
|
+
has_many :associated_audits,:as => :associated,:class_name => NotifiablyAudited.audit_class.name
|
112
112
|
end
|
113
113
|
end
|
114
114
|
|
@@ -224,13 +224,13 @@ module Audited
|
|
224
224
|
|
225
225
|
# Get a specific revision specified by the version number, or +:previous+
|
226
226
|
def revision(version)
|
227
|
-
revision_with
|
227
|
+
revision_with NotifiablyAudited.audit_class.reconstruct_attributes(audits_to(version))
|
228
228
|
end
|
229
229
|
|
230
230
|
# Find the oldest revision recorded prior to the date/time provided.
|
231
231
|
def revision_at(date_or_time)
|
232
232
|
audits = self.audits.up_until(date_or_time)
|
233
|
-
revision_with
|
233
|
+
revision_with NotifiablyAudited.audit_class.reconstruct_attributes(audits) unless audits.empty?
|
234
234
|
end
|
235
235
|
|
236
236
|
# List of attributes that are audited.
|
@@ -250,7 +250,7 @@ module Audited
|
|
250
250
|
revision.send :instance_variable_set, '@destroyed', false
|
251
251
|
revision.send :instance_variable_set, '@_destroyed', false
|
252
252
|
revision.send :instance_variable_set, '@marked_for_destruction', false
|
253
|
-
|
253
|
+
NotifiablyAudited.audit_class.assign_revision_attributes(revision, attributes)
|
254
254
|
|
255
255
|
# Remove any association proxies so that they will be recreated
|
256
256
|
# and reference the correct object for this revision. The only way
|
@@ -442,7 +442,7 @@ module Audited
|
|
442
442
|
# convenience wrapper around
|
443
443
|
# @see Audit#as_user.
|
444
444
|
def audit_as( user, &block )
|
445
|
-
|
445
|
+
NotifiablyAudited.audit_class.as_user( user, &block )
|
446
446
|
end
|
447
447
|
end
|
448
448
|
end
|
File without changes
|
@@ -1,6 +1,6 @@
|
|
1
|
-
module
|
1
|
+
module NotifiablyAudited
|
2
2
|
class Sweeper < ActiveModel::Observer
|
3
|
-
observe
|
3
|
+
observe NotifiablyAudited.audit_class
|
4
4
|
|
5
5
|
def before(controller)
|
6
6
|
self.controller = controller
|
@@ -17,7 +17,7 @@ module Audited
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def current_user
|
20
|
-
controller.send(
|
20
|
+
controller.send(NotifiablyAudited.current_user_method) if controller.respond_to?(NotifiablyAudited.current_user_method, true)
|
21
21
|
end
|
22
22
|
|
23
23
|
def add_observer!(klass)
|
@@ -35,17 +35,17 @@ module Audited
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def controller
|
38
|
-
::
|
38
|
+
::NotifiablyAudited.store[:current_controller]
|
39
39
|
end
|
40
40
|
|
41
41
|
def controller=(value)
|
42
|
-
::
|
42
|
+
::NotifiablyAudited.store[:current_controller] = value
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
47
|
if defined?(ActionController) and defined?(ActionController::Base)
|
48
48
|
ActionController::Base.class_eval do
|
49
|
-
around_filter
|
49
|
+
around_filter NotifiablyAudited::Sweeper.instance
|
50
50
|
end
|
51
51
|
end
|
data/lib/notifiably_audited.rb
CHANGED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: notifiably_audited
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- senthil kumar
|
@@ -108,20 +108,6 @@ dependencies:
|
|
108
108
|
- - ~>
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '1.0'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: private_pub
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - ! '>='
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '0'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - ! '>='
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '0'
|
125
111
|
description: Log all changes to your ActiveRecord models
|
126
112
|
email: senthilkumar.hce@gmail.com
|
127
113
|
executables: []
|
@@ -129,11 +115,12 @@ extensions: []
|
|
129
115
|
extra_rdoc_files: []
|
130
116
|
files:
|
131
117
|
- .gitignore
|
118
|
+
- .travis.yml
|
119
|
+
- .yardopts
|
132
120
|
- Appraisals
|
133
121
|
- CHANGELOG
|
134
122
|
- Gemfile
|
135
123
|
- LICENSE
|
136
|
-
- LICENSE.txt
|
137
124
|
- README.md
|
138
125
|
- Rakefile
|
139
126
|
- audited-activerecord.gemspec
|
@@ -142,14 +129,31 @@ files:
|
|
142
129
|
- gemfiles/rails30.gemfile
|
143
130
|
- gemfiles/rails31.gemfile
|
144
131
|
- gemfiles/rails32.gemfile
|
145
|
-
- lib/
|
146
|
-
- lib/audited/audit.rb
|
147
|
-
- lib/audited/auditor.rb
|
148
|
-
- lib/audited/rspec_matchers.rb
|
149
|
-
- lib/audited/sweeper.rb
|
132
|
+
- lib/notifiably_audited-activerecord.rb
|
150
133
|
- lib/notifiably_audited.rb
|
151
|
-
- lib/notifiably_audited/
|
152
|
-
- notifiably_audited.
|
134
|
+
- lib/notifiably_audited/audit.rb
|
135
|
+
- lib/notifiably_audited/auditor.rb
|
136
|
+
- lib/notifiably_audited/rspec_matchers.rb
|
137
|
+
- lib/notifiably_audited/sweeper.rb
|
138
|
+
- notifiably_audited-0.1.0.gem
|
139
|
+
- notifiably_audited-0.1.1.gem
|
140
|
+
- notifiably_audited-0.1.2.gem
|
141
|
+
- notifiably_audited-0.1.3.gem
|
142
|
+
- notifiably_audited-0.1.4.gem
|
143
|
+
- notifiably_audited-0.1.5.gem
|
144
|
+
- notifiably_audited-0.1.6.gem
|
145
|
+
- notifiably_audited-0.1.7.gem
|
146
|
+
- notifiably_audited-0.1.8.gem
|
147
|
+
- notifiably_audited-0.1.9.gem
|
148
|
+
- notifiably_audited-activerecord-0.1.0.gem
|
149
|
+
- notifiably_audited-activerecord-0.1.1.gem
|
150
|
+
- notifiably_audited-activerecord-0.1.2.gem
|
151
|
+
- notifiably_audited-activerecord-0.1.3.gem
|
152
|
+
- notifiably_audited-activerecord-0.1.4.gem
|
153
|
+
- notifiably_audited-activerecord-0.1.5.gem
|
154
|
+
- notifiably_audited-activerecord-0.1.6.gem
|
155
|
+
- notifiably_audited-activerecord-0.1.8.gem
|
156
|
+
- notifiably_audited-activerecord-0.1.9.gem
|
153
157
|
- spec/audited_spec_helpers.rb
|
154
158
|
- spec/rails_app/config/application.rb
|
155
159
|
- spec/rails_app/config/database.yml
|
data/LICENSE.txt
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
Copyright (c) 2014 TODO: Write your name
|
2
|
-
|
3
|
-
MIT License
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
a copy of this software and associated documentation files (the
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
12
|
-
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
included in all copies or substantial portions of the Software.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/lib/audited.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
module Audited
|
2
|
-
VERSION = '3.0.0'
|
3
|
-
|
4
|
-
class << self
|
5
|
-
attr_accessor :ignored_attributes, :current_user_method, :audit_class
|
6
|
-
|
7
|
-
def store
|
8
|
-
Thread.current[:audited_store] ||= {}
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
@ignored_attributes = %w(lock_version created_at updated_at created_on updated_on)
|
13
|
-
|
14
|
-
@current_user_method = :current_user
|
15
|
-
end
|
data/notifiably_audited.gemspec
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'notifiably_audited/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = "notifiably_audited"
|
8
|
-
spec.version = NotifiablyAudited::VERSION
|
9
|
-
spec.authors = ["TODO: Write your name"]
|
10
|
-
spec.email = ["TODO: Write your email address"]
|
11
|
-
spec.summary = %q{TODO: Write a short summary. Required.}
|
12
|
-
spec.description = %q{TODO: Write a longer description. Optional.}
|
13
|
-
spec.homepage = ""
|
14
|
-
spec.license = "MIT"
|
15
|
-
|
16
|
-
spec.files = `git ls-files -z`.split("\x0")
|
17
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
-
spec.require_paths = ["lib"]
|
20
|
-
|
21
|
-
spec.add_development_dependency "bundler", "~> 1.5"
|
22
|
-
spec.add_development_dependency "rake"
|
23
|
-
end
|