pg_audit_log 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -62,6 +62,7 @@ module PgAuditLog
62
62
  end
63
63
 
64
64
  def create_for_table(table_name)
65
+ PgAuditLog::Entry.install unless PgAuditLog::Entry.installed?
65
66
  PgAuditLog::Function.install unless PgAuditLog::Function.installed?
66
67
  execute <<-SQL
67
68
  CREATE TRIGGER #{trigger_name_for_table(table_name)}
@@ -1,3 +1,3 @@
1
1
  module PgAuditLog
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
@@ -294,4 +294,19 @@ describe PgAuditLog do
294
294
  end
295
295
  end
296
296
 
297
+ describe "when the entry table does not yet exist" do
298
+ before do
299
+ PgAuditLog::Entry.uninstall
300
+ end
301
+
302
+ context "when creating a table" do
303
+ it "should install the entry table then enable the trigger on the table" do
304
+ PgAuditLog::Entry.installed?.should be_false
305
+ connection.create_table("another_table")
306
+ PgAuditLog::Entry.installed?.should be_true
307
+ connection.drop_table("another_table")
308
+ end
309
+ end
310
+ end
311
+
297
312
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_audit_log
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-10-02 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &2172772880 !ruby/object:Gem::Requirement
16
+ requirement: &2168542000 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 3.0.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2172772880
24
+ version_requirements: *2168542000
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: pg
27
- requirement: &2172772120 !ruby/object:Gem::Requirement
27
+ requirement: &2168541140 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 0.9.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2172772120
35
+ version_requirements: *2168541140
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec-rails
38
- requirement: &2172759460 !ruby/object:Gem::Requirement
38
+ requirement: &2168540520 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *2172759460
46
+ version_requirements: *2168540520
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: with_model
49
- requirement: &2172758220 !ruby/object:Gem::Requirement
49
+ requirement: &2168539520 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 0.1.3
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *2172758220
57
+ version_requirements: *2168539520
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: autotest
60
- requirement: &2172756540 !ruby/object:Gem::Requirement
60
+ requirement: &2168538600 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *2172756540
68
+ version_requirements: *2168538600
69
69
  description: A completely transparent audit logging component for your application
70
70
  using a stored procedure and triggers. Comes with specs for your project and a rake
71
71
  task to generate the reverse SQL to undo changes logged
@@ -119,7 +119,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
119
119
  version: '0'
120
120
  segments:
121
121
  - 0
122
- hash: -969039138907551583
122
+ hash: -4484805073833127824
123
123
  required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  none: false
125
125
  requirements:
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  version: '0'
129
129
  segments:
130
130
  - 0
131
- hash: -969039138907551583
131
+ hash: -4484805073833127824
132
132
  requirements: []
133
133
  rubyforge_project:
134
134
  rubygems_version: 1.8.10