pg_audit_log 0.3.4 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -64,6 +64,7 @@ module PgAuditLog
64
64
  def create_for_table(table_name)
65
65
  PgAuditLog::Entry.install unless PgAuditLog::Entry.installed?
66
66
  PgAuditLog::Function.install unless PgAuditLog::Function.installed?
67
+ return if tables_with_triggers.include?(table_name)
67
68
  execute <<-SQL
68
69
  CREATE TRIGGER #{trigger_name_for_table(table_name)}
69
70
  AFTER INSERT OR UPDATE OR DELETE
@@ -1,3 +1,3 @@
1
1
  module PgAuditLog
2
- VERSION = "0.3.4"
2
+ VERSION = "0.3.5"
3
3
  end
@@ -100,6 +100,17 @@ describe PgAuditLog::Triggers do
100
100
  end
101
101
  end
102
102
 
103
+ describe ".create_for_table" do
104
+ context "for a table that already has a trigger" do
105
+ it "should not blow up" do
106
+ PgAuditLog::Triggers.tables_with_triggers.should include(TableWithTriggers.table_name)
107
+ ->{
108
+ PgAuditLog::Triggers.create_for_table(TableWithTriggers.table_name)
109
+ }.should_not raise_error
110
+ end
111
+ end
112
+ end
113
+
103
114
  end
104
115
  end
105
116
 
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.4
4
+ version: 0.3.5
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: &2164346140 !ruby/object:Gem::Requirement
16
+ requirement: &2156249180 !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: *2164346140
24
+ version_requirements: *2156249180
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: pg
27
- requirement: &2164345300 !ruby/object:Gem::Requirement
27
+ requirement: &2156241760 !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: *2164345300
35
+ version_requirements: *2156241760
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec-rails
38
- requirement: &2164344340 !ruby/object:Gem::Requirement
38
+ requirement: &2156241000 !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: *2164344340
46
+ version_requirements: *2156241000
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: with_model
49
- requirement: &2164343240 !ruby/object:Gem::Requirement
49
+ requirement: &2156239820 !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: *2164343240
57
+ version_requirements: *2156239820
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: autotest
60
- requirement: &2164342280 !ruby/object:Gem::Requirement
60
+ requirement: &2156238920 !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: *2164342280
68
+ version_requirements: *2156238920
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: -2193124728836431655
122
+ hash: -584131678967197646
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: -2193124728836431655
131
+ hash: -584131678967197646
132
132
  requirements: []
133
133
  rubyforge_project:
134
134
  rubygems_version: 1.8.10