pg_audit_log 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -75,6 +75,7 @@ module PgAuditLog
75
75
  end
76
76
 
77
77
  def drop_for_table(table_name)
78
+ return unless tables_with_triggers.include?(table_name)
78
79
  execute "DROP TRIGGER #{trigger_name_for_table(table_name)} ON #{table_name}"
79
80
  end
80
81
 
@@ -1,3 +1,3 @@
1
1
  module PgAuditLog
2
- VERSION = "0.3.5"
2
+ VERSION = "0.3.6"
3
3
  end
@@ -111,6 +111,17 @@ describe PgAuditLog::Triggers do
111
111
  end
112
112
  end
113
113
 
114
+ describe ".drop_for_table" do
115
+ context "for a table that has no trigger" do
116
+ it "should not blow up" do
117
+ PgAuditLog::Triggers.drop_for_table(TableWithTriggers.table_name)
118
+ ->{
119
+ PgAuditLog::Triggers.drop_for_table(TableWithTriggers.table_name)
120
+ }.should_not raise_error
121
+ end
122
+ end
123
+ end
124
+
114
125
  end
115
126
  end
116
127
 
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.5
4
+ version: 0.3.6
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: &2156249180 !ruby/object:Gem::Requirement
16
+ requirement: &2160154260 !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: *2156249180
24
+ version_requirements: *2160154260
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: pg
27
- requirement: &2156241760 !ruby/object:Gem::Requirement
27
+ requirement: &2160153480 !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: *2156241760
35
+ version_requirements: *2160153480
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec-rails
38
- requirement: &2156241000 !ruby/object:Gem::Requirement
38
+ requirement: &2160152760 !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: *2156241000
46
+ version_requirements: *2160152760
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: with_model
49
- requirement: &2156239820 !ruby/object:Gem::Requirement
49
+ requirement: &2160151720 !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: *2156239820
57
+ version_requirements: *2160151720
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: autotest
60
- requirement: &2156238920 !ruby/object:Gem::Requirement
60
+ requirement: &2160150700 !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: *2156238920
68
+ version_requirements: *2160150700
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: -584131678967197646
122
+ hash: 2478681401597337909
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: -584131678967197646
131
+ hash: 2478681401597337909
132
132
  requirements: []
133
133
  rubyforge_project:
134
134
  rubygems_version: 1.8.10