notifiably_audited 0.0.5 → 0.0.6
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 +8 -8
- data/lib/audited/adapters/active_record/audit.rb +69 -0
- data/lib/audited/adapters/active_record.rb +15 -0
- data/lib/audited-activerecord.rb +2 -0
- data/lib/generators/audited/install_generator.rb +28 -0
- data/lib/generators/audited/templates/add_association_to_audits.rb +11 -0
- data/lib/generators/audited/templates/add_comment_to_audits.rb +9 -0
- data/lib/generators/audited/templates/add_remote_address_to_audits.rb +10 -0
- data/lib/generators/audited/templates/install.rb +35 -0
- data/lib/generators/audited/templates/rename_association_to_associated.rb +23 -0
- data/lib/generators/audited/templates/rename_changes_to_audited_changes.rb +9 -0
- data/lib/generators/audited/templates/rename_parent_to_association.rb +11 -0
- data/lib/generators/audited/upgrade_generator.rb +63 -0
- metadata +24 -157
- data/.gitignore +0 -17
- data/Appraisals +0 -11
- data/CHANGELOG +0 -34
- data/Gemfile +0 -3
- data/LICENSE.txt +0 -22
- data/README.md +0 -234
- data/Rakefile +0 -24
- data/audited-activerecord.gemspec +0 -21
- data/audited-mongo_mapper.gemspec +0 -21
- data/audited.gemspec +0 -27
- data/gemfiles/rails30.gemfile +0 -7
- data/gemfiles/rails31.gemfile +0 -7
- data/gemfiles/rails32.gemfile +0 -7
- data/lib/audited/audit.rb +0 -115
- data/lib/audited/auditor.rb +0 -449
- data/lib/audited/rspec_matchers.rb +0 -173
- data/lib/audited/sweeper.rb +0 -51
- data/lib/audited.rb +0 -15
- data/lib/notifiably_audited/version.rb +0 -3
- data/lib/notifiably_audited.rb +0 -15
- data/notifiably_audited.gemspec +0 -23
- data/spec/audited_spec_helpers.rb +0 -31
- data/spec/rails_app/config/application.rb +0 -5
- data/spec/rails_app/config/database.yml +0 -24
- data/spec/rails_app/config/environment.rb +0 -5
- data/spec/rails_app/config/environments/development.rb +0 -19
- data/spec/rails_app/config/environments/production.rb +0 -33
- data/spec/rails_app/config/environments/test.rb +0 -33
- data/spec/rails_app/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/rails_app/config/initializers/inflections.rb +0 -2
- data/spec/rails_app/config/initializers/secret_token.rb +0 -2
- data/spec/rails_app/config/routes.rb +0 -6
- data/spec/spec_helper.rb +0 -23
- data/spec/support/active_record/models.rb +0 -84
- data/spec/support/active_record/schema.rb +0 -54
- data/spec/support/mongo_mapper/connection.rb +0 -4
- data/spec/support/mongo_mapper/models.rb +0 -210
- data/test/db/version_1.rb +0 -17
- data/test/db/version_2.rb +0 -18
- data/test/db/version_3.rb +0 -19
- data/test/db/version_4.rb +0 -20
- data/test/db/version_5.rb +0 -18
- data/test/install_generator_test.rb +0 -17
- data/test/test_helper.rb +0 -19
- data/test/upgrade_generator_test.rb +0 -65
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NWE2NzIwZTJkZjkwNWI4ZWVjNzZiZjRlNGE2ZWVmNjVjZWJhODk3Mg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YzYzODE2Mzg1ZWM1YjVkZjJjODc5OTE4MzgzYzdmMzU1NTE5ODk3OA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzVkNzBlZmU5MzU0MGNiMTY5MWEyZjNmNTM5ZTY5YTUzMWE4NTg2MWYxNDE5
|
10
|
+
ZGRiYjAwZGIwODk5YWE5Y2NlYWU0Y2Y5ZjFlNWM3NjU2NjFiNjgzZGRkMDAw
|
11
|
+
NGVjYzY1N2RlNGFlNGYzOWE5NDU3ZWY4NGUzZGJkMjdmMzI3M2Q=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OTMyZTdkNTgzZTBjNDIwYzE4Yjk0NTMzYzY3ZWM4YTkzYWJmZDNmZGZiMjcx
|
14
|
+
ZmMxN2MwNDVlNWIzZmRiYzNiNjRlYzdjOTM5YWQ1YzBlYTg5ZDUyMTM5YTAx
|
15
|
+
YWZmOTg4ZWZlNDI5NjEyNGUyMjA3ZDQzYmNhOWQzZDY2MTcyZmQ=
|
@@ -0,0 +1,69 @@
|
|
1
|
+
require 'set'
|
2
|
+
require 'audited/audit'
|
3
|
+
|
4
|
+
module Audited
|
5
|
+
module Adapters
|
6
|
+
module ActiveRecord
|
7
|
+
# Audit saves the changes to ActiveRecord models. It has the following attributes:
|
8
|
+
#
|
9
|
+
# * <tt>auditable</tt>: the ActiveRecord model that was changed
|
10
|
+
# * <tt>user</tt>: the user that performed the change; a string or an ActiveRecord model
|
11
|
+
# * <tt>action</tt>: one of create, update, or delete
|
12
|
+
# * <tt>audited_changes</tt>: a serialized hash of all the changes
|
13
|
+
# * <tt>comment</tt>: a comment set with the audit
|
14
|
+
# * <tt>created_at</tt>: Time that the change was performed
|
15
|
+
#
|
16
|
+
class Audit < ::ActiveRecord::Base
|
17
|
+
include Audited::Audit
|
18
|
+
|
19
|
+
|
20
|
+
serialize :audited_changes
|
21
|
+
|
22
|
+
default_scope order(:version)
|
23
|
+
scope :descending, reorder("version DESC")
|
24
|
+
scope :creates, :conditions => {:action => 'create'}
|
25
|
+
scope :updates, :conditions => {:action => 'update'}
|
26
|
+
scope :destroys, :conditions => {:action => 'destroy'}
|
27
|
+
|
28
|
+
scope :up_until, lambda {|date_or_time| where("created_at <= ?", date_or_time) }
|
29
|
+
scope :from_version, lambda {|version| where(['version >= ?', version]) }
|
30
|
+
scope :to_version, lambda {|version| where(['version <= ?', version]) }
|
31
|
+
|
32
|
+
# Return all audits older than the current one.
|
33
|
+
def ancestors
|
34
|
+
self.class.where(['auditable_id = ? and auditable_type = ? and version <= ?',
|
35
|
+
auditable_id, auditable_type, version])
|
36
|
+
end
|
37
|
+
|
38
|
+
# Allows user to be set to either a string or an ActiveRecord object
|
39
|
+
# @private
|
40
|
+
def user_as_string=(user)
|
41
|
+
# reset both either way
|
42
|
+
self.user_as_model = self.username = nil
|
43
|
+
user.is_a?(::ActiveRecord::Base) ?
|
44
|
+
self.user_as_model = user :
|
45
|
+
self.username = user
|
46
|
+
end
|
47
|
+
alias_method :user_as_model=, :user=
|
48
|
+
alias_method :user=, :user_as_string=
|
49
|
+
|
50
|
+
# @private
|
51
|
+
def user_as_string
|
52
|
+
self.user_as_model || self.username
|
53
|
+
end
|
54
|
+
alias_method :user_as_model, :user
|
55
|
+
alias_method :user, :user_as_string
|
56
|
+
|
57
|
+
private
|
58
|
+
def set_version_number
|
59
|
+
max = self.class.maximum(:version,
|
60
|
+
:conditions => {
|
61
|
+
:auditable_id => auditable_id,
|
62
|
+
:auditable_type => auditable_type
|
63
|
+
}) || 0
|
64
|
+
self.version = max + 1
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'active_record'
|
2
|
+
require 'audited/auditor'
|
3
|
+
require 'audited/adapters/active_record/audit'
|
4
|
+
|
5
|
+
module Audited::Auditor::ClassMethods
|
6
|
+
def default_ignored_attributes
|
7
|
+
[self.primary_key, inheritance_column]
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
::ActiveRecord::Base.send :include, Audited::Auditor
|
12
|
+
|
13
|
+
Audited.audit_class = Audited::Adapters::ActiveRecord::Audit
|
14
|
+
|
15
|
+
require 'audited/sweeper'
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
require 'rails/generators/migration'
|
3
|
+
require 'active_record'
|
4
|
+
require 'rails/generators/active_record'
|
5
|
+
|
6
|
+
module Audited
|
7
|
+
module Generators
|
8
|
+
class InstallGenerator < Rails::Generators::Base
|
9
|
+
include Rails::Generators::Migration
|
10
|
+
|
11
|
+
source_root File.expand_path("../templates", __FILE__)
|
12
|
+
|
13
|
+
# Implement the required interface for Rails::Generators::Migration.
|
14
|
+
def self.next_migration_number(dirname) #:nodoc:
|
15
|
+
next_migration_number = current_migration_number(dirname) + 1
|
16
|
+
if ActiveRecord::Base.timestamped_migrations
|
17
|
+
[Time.now.utc.strftime("%Y%m%d%H%M%S"), "%.14d" % next_migration_number].max
|
18
|
+
else
|
19
|
+
"%.3d" % next_migration_number
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def copy_migration
|
24
|
+
migration_template 'install.rb', 'db/migrate/install_audited.rb'
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class <%= migration_class_name %> < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
add_column :audits, :association_id, :integer
|
4
|
+
add_column :audits, :association_type, :string
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.down
|
8
|
+
remove_column :audits, :association_type
|
9
|
+
remove_column :audits, :association_id
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
class <%= migration_class_name %> < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :audits, :force => true do |t|
|
4
|
+
t.column :auditable_id, :integer
|
5
|
+
t.column :auditable_type, :string
|
6
|
+
t.column :associated_id, :integer
|
7
|
+
t.column :associated_type, :string
|
8
|
+
t.column :user_id, :integer
|
9
|
+
t.column :user_type, :string
|
10
|
+
t.column :username, :string
|
11
|
+
t.column :action, :string
|
12
|
+
t.column :audited_changes, :text
|
13
|
+
t.column :version, :integer, :default => 0
|
14
|
+
t.column :comment, :string
|
15
|
+
t.column :remote_address, :string
|
16
|
+
# added by senthil
|
17
|
+
#========
|
18
|
+
t.column :meta, :string
|
19
|
+
t.column :receiver_id, :integer
|
20
|
+
t.column :checked, :boolean
|
21
|
+
t.column :title, :string
|
22
|
+
#========
|
23
|
+
t.column :created_at, :datetime
|
24
|
+
end
|
25
|
+
|
26
|
+
add_index :audits, [:auditable_id, :auditable_type], :name => 'auditable_index'
|
27
|
+
add_index :audits, [:associated_id, :associated_type], :name => 'associated_index'
|
28
|
+
add_index :audits, [:user_id, :user_type], :name => 'user_index'
|
29
|
+
add_index :audits, :created_at
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.down
|
33
|
+
drop_table :audits
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
class <%= migration_class_name %> < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
if index_exists? :audits, [:association_id, :association_type], :name => 'association_index'
|
4
|
+
remove_index :audits, :name => 'association_index'
|
5
|
+
end
|
6
|
+
|
7
|
+
rename_column :audits, :association_id, :associated_id
|
8
|
+
rename_column :audits, :association_type, :associated_type
|
9
|
+
|
10
|
+
add_index :audits, [:associated_id, :associated_type], :name => 'associated_index'
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.down
|
14
|
+
if index_exists? :audits, [:associated_id, :associated_type], :name => 'associated_index'
|
15
|
+
remove_index :audits, :name => 'associated_index'
|
16
|
+
end
|
17
|
+
|
18
|
+
rename_column :audits, :associated_type, :association_type
|
19
|
+
rename_column :audits, :associated_id, :association_id
|
20
|
+
|
21
|
+
add_index :audits, [:association_id, :association_type], :name => 'association_index'
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class <%= migration_class_name %> < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
rename_column :audits, :auditable_parent_id, :association_id
|
4
|
+
rename_column :audits, :auditable_parent_type, :association_type
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.down
|
8
|
+
rename_column :audits, :association_type, :auditable_parent_type
|
9
|
+
rename_column :audits, :association_id, :auditable_parent_id
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
require 'rails/generators/migration'
|
3
|
+
require 'active_record'
|
4
|
+
require 'rails/generators/active_record'
|
5
|
+
|
6
|
+
module Audited
|
7
|
+
module Generators
|
8
|
+
class UpgradeGenerator < Rails::Generators::Base
|
9
|
+
include Rails::Generators::Migration
|
10
|
+
|
11
|
+
source_root File.expand_path("../templates", __FILE__)
|
12
|
+
|
13
|
+
# Implement the required interface for Rails::Generators::Migration.
|
14
|
+
def self.next_migration_number(dirname) #:nodoc:
|
15
|
+
next_migration_number = current_migration_number(dirname) + 1
|
16
|
+
if ActiveRecord::Base.timestamped_migrations
|
17
|
+
[Time.now.utc.strftime("%Y%m%d%H%M%S"), "%.14d" % next_migration_number].max
|
18
|
+
else
|
19
|
+
"%.3d" % next_migration_number
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def copy_templates
|
24
|
+
migrations_to_be_applied do |m|
|
25
|
+
migration_template "#{m}.rb", "db/migrate/#{m}.rb"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def migrations_to_be_applied
|
32
|
+
Audited::Adapters::ActiveRecord::Audit.reset_column_information
|
33
|
+
columns = Audited::Adapters::ActiveRecord::Audit.columns.map(&:name)
|
34
|
+
|
35
|
+
unless columns.include?( 'comment' )
|
36
|
+
yield :add_comment_to_audits
|
37
|
+
end
|
38
|
+
|
39
|
+
if columns.include?( 'changes' )
|
40
|
+
yield :rename_changes_to_audited_changes
|
41
|
+
end
|
42
|
+
|
43
|
+
unless columns.include?( 'remote_address' )
|
44
|
+
yield :add_remote_address_to_audits
|
45
|
+
end
|
46
|
+
|
47
|
+
unless columns.include?( 'association_id' )
|
48
|
+
if columns.include?('auditable_parent_id')
|
49
|
+
yield :rename_parent_to_association
|
50
|
+
else
|
51
|
+
unless columns.include?( 'associated_id' )
|
52
|
+
yield :add_association_to_audits
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
if columns.include?( 'association_id' )
|
58
|
+
yield :rename_association_to_associated
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
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.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Keepers
|
@@ -16,169 +16,52 @@ cert_chain: []
|
|
16
16
|
date: 2014-03-19 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
|
-
name:
|
20
|
-
requirement: !ruby/object:Gem::Requirement
|
21
|
-
requirements:
|
22
|
-
- - ~>
|
23
|
-
- !ruby/object:Gem::Version
|
24
|
-
version: '3.0'
|
25
|
-
type: :development
|
26
|
-
prerelease: false
|
27
|
-
version_requirements: !ruby/object:Gem::Requirement
|
28
|
-
requirements:
|
29
|
-
- - ~>
|
30
|
-
- !ruby/object:Gem::Version
|
31
|
-
version: '3.0'
|
32
|
-
- !ruby/object:Gem::Dependency
|
33
|
-
name: appraisal
|
34
|
-
requirement: !ruby/object:Gem::Requirement
|
35
|
-
requirements:
|
36
|
-
- - ~>
|
37
|
-
- !ruby/object:Gem::Version
|
38
|
-
version: '0.4'
|
39
|
-
type: :development
|
40
|
-
prerelease: false
|
41
|
-
version_requirements: !ruby/object:Gem::Requirement
|
42
|
-
requirements:
|
43
|
-
- - ~>
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: '0.4'
|
46
|
-
- !ruby/object:Gem::Dependency
|
47
|
-
name: bson_ext
|
48
|
-
requirement: !ruby/object:Gem::Requirement
|
49
|
-
requirements:
|
50
|
-
- - ~>
|
51
|
-
- !ruby/object:Gem::Version
|
52
|
-
version: '1.6'
|
53
|
-
type: :development
|
54
|
-
prerelease: false
|
55
|
-
version_requirements: !ruby/object:Gem::Requirement
|
56
|
-
requirements:
|
57
|
-
- - ~>
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
version: '1.6'
|
60
|
-
- !ruby/object:Gem::Dependency
|
61
|
-
name: mongo_mapper
|
19
|
+
name: audited
|
62
20
|
requirement: !ruby/object:Gem::Requirement
|
63
21
|
requirements:
|
64
|
-
- -
|
22
|
+
- - '='
|
65
23
|
- !ruby/object:Gem::Version
|
66
|
-
version:
|
67
|
-
type: :
|
24
|
+
version: 0.0.6
|
25
|
+
type: :runtime
|
68
26
|
prerelease: false
|
69
27
|
version_requirements: !ruby/object:Gem::Requirement
|
70
28
|
requirements:
|
71
|
-
- -
|
29
|
+
- - '='
|
72
30
|
- !ruby/object:Gem::Version
|
73
|
-
version:
|
31
|
+
version: 0.0.6
|
74
32
|
- !ruby/object:Gem::Dependency
|
75
|
-
name:
|
33
|
+
name: activerecord
|
76
34
|
requirement: !ruby/object:Gem::Requirement
|
77
35
|
requirements:
|
78
36
|
- - ~>
|
79
37
|
- !ruby/object:Gem::Version
|
80
38
|
version: '3.0'
|
81
|
-
type: :
|
39
|
+
type: :runtime
|
82
40
|
prerelease: false
|
83
41
|
version_requirements: !ruby/object:Gem::Requirement
|
84
42
|
requirements:
|
85
43
|
- - ~>
|
86
44
|
- !ruby/object:Gem::Version
|
87
45
|
version: '3.0'
|
88
|
-
|
89
|
-
name: rspec-rails
|
90
|
-
requirement: !ruby/object:Gem::Requirement
|
91
|
-
requirements:
|
92
|
-
- - ~>
|
93
|
-
- !ruby/object:Gem::Version
|
94
|
-
version: '2.0'
|
95
|
-
type: :development
|
96
|
-
prerelease: false
|
97
|
-
version_requirements: !ruby/object:Gem::Requirement
|
98
|
-
requirements:
|
99
|
-
- - ~>
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
version: '2.0'
|
102
|
-
- !ruby/object:Gem::Dependency
|
103
|
-
name: sqlite3
|
104
|
-
requirement: !ruby/object:Gem::Requirement
|
105
|
-
requirements:
|
106
|
-
- - ~>
|
107
|
-
- !ruby/object:Gem::Version
|
108
|
-
version: '1.0'
|
109
|
-
type: :development
|
110
|
-
prerelease: false
|
111
|
-
version_requirements: !ruby/object:Gem::Requirement
|
112
|
-
requirements:
|
113
|
-
- - ~>
|
114
|
-
- !ruby/object:Gem::Version
|
115
|
-
version: '1.0'
|
116
|
-
- !ruby/object:Gem::Dependency
|
117
|
-
name: private_pub
|
118
|
-
requirement: !ruby/object:Gem::Requirement
|
119
|
-
requirements:
|
120
|
-
- - ! '>='
|
121
|
-
- !ruby/object:Gem::Version
|
122
|
-
version: '0'
|
123
|
-
type: :development
|
124
|
-
prerelease: false
|
125
|
-
version_requirements: !ruby/object:Gem::Requirement
|
126
|
-
requirements:
|
127
|
-
- - ! '>='
|
128
|
-
- !ruby/object:Gem::Version
|
129
|
-
version: '0'
|
130
|
-
description: Log all changes to your models
|
46
|
+
description: Log all changes to your ActiveRecord models
|
131
47
|
email: info@collectiveidea.com
|
132
48
|
executables: []
|
133
49
|
extensions: []
|
134
50
|
extra_rdoc_files: []
|
135
51
|
files:
|
136
|
-
- .gitignore
|
137
|
-
- Appraisals
|
138
|
-
- CHANGELOG
|
139
|
-
- Gemfile
|
140
52
|
- LICENSE
|
141
|
-
-
|
142
|
-
-
|
143
|
-
-
|
144
|
-
- audited
|
145
|
-
- audited
|
146
|
-
- audited.
|
147
|
-
-
|
148
|
-
-
|
149
|
-
-
|
150
|
-
- lib/audited.rb
|
151
|
-
- lib/audited/
|
152
|
-
- lib/audited/
|
153
|
-
- lib/audited/rspec_matchers.rb
|
154
|
-
- lib/audited/sweeper.rb
|
155
|
-
- lib/notifiably_audited.rb
|
156
|
-
- lib/notifiably_audited/version.rb
|
157
|
-
- notifiably_audited.gemspec
|
158
|
-
- spec/audited_spec_helpers.rb
|
159
|
-
- spec/rails_app/config/application.rb
|
160
|
-
- spec/rails_app/config/database.yml
|
161
|
-
- spec/rails_app/config/environment.rb
|
162
|
-
- spec/rails_app/config/environments/development.rb
|
163
|
-
- spec/rails_app/config/environments/production.rb
|
164
|
-
- spec/rails_app/config/environments/test.rb
|
165
|
-
- spec/rails_app/config/initializers/backtrace_silencers.rb
|
166
|
-
- spec/rails_app/config/initializers/inflections.rb
|
167
|
-
- spec/rails_app/config/initializers/secret_token.rb
|
168
|
-
- spec/rails_app/config/routes.rb
|
169
|
-
- spec/spec_helper.rb
|
170
|
-
- spec/support/active_record/models.rb
|
171
|
-
- spec/support/active_record/schema.rb
|
172
|
-
- spec/support/mongo_mapper/connection.rb
|
173
|
-
- spec/support/mongo_mapper/models.rb
|
174
|
-
- test/db/version_1.rb
|
175
|
-
- test/db/version_2.rb
|
176
|
-
- test/db/version_3.rb
|
177
|
-
- test/db/version_4.rb
|
178
|
-
- test/db/version_5.rb
|
179
|
-
- test/install_generator_test.rb
|
180
|
-
- test/test_helper.rb
|
181
|
-
- test/upgrade_generator_test.rb
|
53
|
+
- lib/audited-activerecord.rb
|
54
|
+
- lib/audited/adapters/active_record.rb
|
55
|
+
- lib/audited/adapters/active_record/audit.rb
|
56
|
+
- lib/generators/audited/install_generator.rb
|
57
|
+
- lib/generators/audited/templates/add_association_to_audits.rb
|
58
|
+
- lib/generators/audited/templates/add_comment_to_audits.rb
|
59
|
+
- lib/generators/audited/templates/add_remote_address_to_audits.rb
|
60
|
+
- lib/generators/audited/templates/install.rb
|
61
|
+
- lib/generators/audited/templates/rename_association_to_associated.rb
|
62
|
+
- lib/generators/audited/templates/rename_changes_to_audited_changes.rb
|
63
|
+
- lib/generators/audited/templates/rename_parent_to_association.rb
|
64
|
+
- lib/generators/audited/upgrade_generator.rb
|
182
65
|
homepage: https://github.com/collectiveidea/audited
|
183
66
|
licenses:
|
184
67
|
- MIT
|
@@ -202,22 +85,6 @@ rubyforge_project:
|
|
202
85
|
rubygems_version: 2.2.2
|
203
86
|
signing_key:
|
204
87
|
specification_version: 4
|
205
|
-
summary: Log all changes to your models
|
206
|
-
test_files:
|
207
|
-
- spec/audited_spec_helpers.rb
|
208
|
-
- spec/rails_app/config/application.rb
|
209
|
-
- spec/rails_app/config/database.yml
|
210
|
-
- spec/rails_app/config/environment.rb
|
211
|
-
- spec/rails_app/config/environments/development.rb
|
212
|
-
- spec/rails_app/config/environments/production.rb
|
213
|
-
- spec/rails_app/config/environments/test.rb
|
214
|
-
- spec/rails_app/config/initializers/backtrace_silencers.rb
|
215
|
-
- spec/rails_app/config/initializers/inflections.rb
|
216
|
-
- spec/rails_app/config/initializers/secret_token.rb
|
217
|
-
- spec/rails_app/config/routes.rb
|
218
|
-
- spec/spec_helper.rb
|
219
|
-
- spec/support/active_record/models.rb
|
220
|
-
- spec/support/active_record/schema.rb
|
221
|
-
- spec/support/mongo_mapper/connection.rb
|
222
|
-
- spec/support/mongo_mapper/models.rb
|
88
|
+
summary: Log all changes to your ActiveRecord models
|
89
|
+
test_files: []
|
223
90
|
has_rdoc:
|
data/.gitignore
DELETED
data/Appraisals
DELETED
data/CHANGELOG
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
Audited ChangeLog
|
2
|
-
-------------------------------------------------------------------------------
|
3
|
-
* 2012-04-10 - Add Audit scopes for creates, updates and destroys [chriswfx]
|
4
|
-
* 2011-10-25 - Made ignored_attributes configurable [senny]
|
5
|
-
* 2011-09-09 - Rails 3.x support
|
6
|
-
Support for associated audits
|
7
|
-
Support for remote IP address storage
|
8
|
-
Plenty of bug fixes and refactoring
|
9
|
-
[kennethkalmer, ineu, PatrickMa, jrozner, dwarburton, bsiggelkow, dgm]
|
10
|
-
* 2009-01-27 - Store old and new values for updates, and store all attributes on destroy.
|
11
|
-
Refactored revisioning methods to work as expected
|
12
|
-
* 2008-10-10 - changed to make it work in development mode
|
13
|
-
* 2008-09-24 - Add ability to record parent record of the record being audited
|
14
|
-
[Kenneth Kalmer]
|
15
|
-
* 2008-04-19 - refactored to make compatible with dirty tracking in edge rails
|
16
|
-
and to stop storing both old and new values in a single audit
|
17
|
-
* 2008-04-18 - Fix NoMethodError when trying to access the :previous revision
|
18
|
-
on a model that doesn't have previous revisions [Alex Soto]
|
19
|
-
* 2008-03-21 - added #changed_attributes to get access to the changes before a
|
20
|
-
save [Chris Parker]
|
21
|
-
* 2007-12-16 - Added #revision_at for retrieving a revision from a specific
|
22
|
-
time [Jacob Atzen]
|
23
|
-
* 2007-12-16 - Fix error when getting revision from audit with no changes
|
24
|
-
[Geoffrey Wiseman]
|
25
|
-
* 2007-12-16 - Remove dependency on acts_as_list
|
26
|
-
* 2007-06-17 - Added support getting previous revisions
|
27
|
-
* 2006-11-17 - Replaced use of singleton User.current_user with cache sweeper
|
28
|
-
implementation for auditing the user that made the change
|
29
|
-
* 2006-11-17 - added migration generator
|
30
|
-
* 2006-08-14 - incorporated changes from Michael Schuerig to write_attribute
|
31
|
-
that saves the new value after every change and not just the
|
32
|
-
first, and performs proper type-casting before doing comparisons
|
33
|
-
* 2006-08-14 - The "changes" are now saved as a serialized hash
|
34
|
-
* 2006-07-21 - initial version
|
data/Gemfile
DELETED
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.
|