audited-activerecord 4.0.0.rc1 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,5 @@
1
+ module Audited
2
+ module ActiveRecord
3
+ VERSION = "4.0.0"
4
+ end
5
+ end
@@ -11,13 +11,14 @@ module Audited
11
11
  # * <tt>action</tt>: one of create, update, or delete
12
12
  # * <tt>audited_changes</tt>: a serialized hash of all the changes
13
13
  # * <tt>comment</tt>: a comment set with the audit
14
+ # * <tt>version</tt>: the version of the model
15
+ # * <tt>request_uuid</tt>: a uuid based that allows audits from the same controller request
14
16
  # * <tt>created_at</tt>: Time that the change was performed
15
17
  #
16
18
  class Audit < ::ActiveRecord::Base
17
19
  include Audited::Audit
18
20
  include ActiveModel::Observing
19
21
 
20
-
21
22
  serialize :audited_changes
22
23
 
23
24
  default_scope ->{ order(:version)}
@@ -0,0 +1,10 @@
1
+ class <%= migration_class_name %> < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :audits, :request_uuid, :string
4
+ add_index :audits, :request_uuid
5
+ end
6
+
7
+ def self.down
8
+ remove_column :audits, :request_uuid
9
+ end
10
+ end
@@ -13,12 +13,14 @@ class <%= migration_class_name %> < ActiveRecord::Migration
13
13
  t.column :version, :integer, :default => 0
14
14
  t.column :comment, :string
15
15
  t.column :remote_address, :string
16
+ t.column :request_uuid, :string
16
17
  t.column :created_at, :datetime
17
18
  end
18
19
 
19
20
  add_index :audits, [:auditable_id, :auditable_type], :name => 'auditable_index'
20
21
  add_index :audits, [:associated_id, :associated_type], :name => 'associated_index'
21
22
  add_index :audits, [:user_id, :user_type], :name => 'user_index'
23
+ add_index :audits, :request_uuid
22
24
  add_index :audits, :created_at
23
25
  end
24
26
 
@@ -44,6 +44,10 @@ module Audited
44
44
  yield :add_remote_address_to_audits
45
45
  end
46
46
 
47
+ unless columns.include?( 'request_uuid' )
48
+ yield :add_request_uuid_to_audits
49
+ end
50
+
47
51
  unless columns.include?( 'association_id' )
48
52
  if columns.include?('auditable_parent_id')
49
53
  yield :rename_parent_to_association
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: audited-activerecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.rc1
4
+ version: 4.0.0
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Brandon Keepers
@@ -13,34 +14,38 @@ authors:
13
14
  autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
- date: 2014-07-30 00:00:00.000000000 Z
17
+ date: 2014-09-04 00:00:00.000000000 Z
17
18
  dependencies:
18
19
  - !ruby/object:Gem::Dependency
19
20
  name: audited
20
21
  requirement: !ruby/object:Gem::Requirement
22
+ none: false
21
23
  requirements:
22
24
  - - '='
23
25
  - !ruby/object:Gem::Version
24
- version: 4.0.0.rc1
26
+ version: 4.0.0
25
27
  type: :runtime
26
28
  prerelease: false
27
29
  version_requirements: !ruby/object:Gem::Requirement
30
+ none: false
28
31
  requirements:
29
32
  - - '='
30
33
  - !ruby/object:Gem::Version
31
- version: 4.0.0.rc1
34
+ version: 4.0.0
32
35
  - !ruby/object:Gem::Dependency
33
36
  name: activerecord
34
37
  requirement: !ruby/object:Gem::Requirement
38
+ none: false
35
39
  requirements:
36
- - - "~>"
40
+ - - ~>
37
41
  - !ruby/object:Gem::Version
38
42
  version: '4.0'
39
43
  type: :runtime
40
44
  prerelease: false
41
45
  version_requirements: !ruby/object:Gem::Requirement
46
+ none: false
42
47
  requirements:
43
- - - "~>"
48
+ - - ~>
44
49
  - !ruby/object:Gem::Version
45
50
  version: '4.0'
46
51
  description: Log all changes to your ActiveRecord models
@@ -49,41 +54,50 @@ executables: []
49
54
  extensions: []
50
55
  extra_rdoc_files: []
51
56
  files:
52
- - LICENSE
53
57
  - lib/audited-activerecord.rb
58
+ - lib/audited/active_record/version.rb
54
59
  - lib/audited/adapters/active_record.rb
55
60
  - lib/audited/adapters/active_record/audit.rb
56
61
  - lib/generators/audited/install_generator.rb
57
62
  - lib/generators/audited/templates/add_association_to_audits.rb
58
63
  - lib/generators/audited/templates/add_comment_to_audits.rb
59
64
  - lib/generators/audited/templates/add_remote_address_to_audits.rb
65
+ - lib/generators/audited/templates/add_request_uuid_to_audits.rb
60
66
  - lib/generators/audited/templates/install.rb
61
67
  - lib/generators/audited/templates/rename_association_to_associated.rb
62
68
  - lib/generators/audited/templates/rename_changes_to_audited_changes.rb
63
69
  - lib/generators/audited/templates/rename_parent_to_association.rb
64
70
  - lib/generators/audited/upgrade_generator.rb
71
+ - LICENSE
65
72
  homepage: https://github.com/collectiveidea/audited
66
73
  licenses:
67
74
  - MIT
68
- metadata: {}
69
75
  post_install_message:
70
76
  rdoc_options: []
71
77
  require_paths:
72
78
  - lib
73
79
  required_ruby_version: !ruby/object:Gem::Requirement
80
+ none: false
74
81
  requirements:
75
- - - ">="
82
+ - - ! '>='
76
83
  - !ruby/object:Gem::Version
77
84
  version: '0'
85
+ segments:
86
+ - 0
87
+ hash: 1630490927479577486
78
88
  required_rubygems_version: !ruby/object:Gem::Requirement
89
+ none: false
79
90
  requirements:
80
- - - ">"
91
+ - - ! '>='
81
92
  - !ruby/object:Gem::Version
82
- version: 1.3.1
93
+ version: '0'
94
+ segments:
95
+ - 0
96
+ hash: 1630490927479577486
83
97
  requirements: []
84
98
  rubyforge_project:
85
- rubygems_version: 2.2.2
99
+ rubygems_version: 1.8.29
86
100
  signing_key:
87
- specification_version: 4
101
+ specification_version: 3
88
102
  summary: Log all changes to your ActiveRecord models
89
103
  test_files: []
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 1408c0258dd9886b708c2f3f342123b18ba29ad7
4
- data.tar.gz: 6e71042fe4b7fe74348597c92b6464129ddc81a3
5
- SHA512:
6
- metadata.gz: 75ed5287689d0e0909a46d137da2d5ce0c6b152e2d13d59895e74134fa02de42ffdd9757647536ffd1dc215f0873b52b97231c77619992b2142d119905e07a1d
7
- data.tar.gz: 9b43d3f674d2746fdad0ded1e16cd612ba52ce26b64223653c177d3af25a38b32d5d228f365e42b6bb71230ff55f398b3432283720c993c77ad8a8b845e20fd7