active-record-without-callbacks 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "active-record-without-callbacks"
8
- s.version = "0.0.3"
8
+ s.version = "0.0.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kasper Johansen"]
12
- s.date = "2013-04-08"
12
+ s.date = "2013-04-10"
13
13
  s.description = "A method that allows you to run code without callbacks for a specific active-record model."
14
14
  s.email = "kj@gfish.com"
15
15
  s.extra_rdoc_files = [
@@ -49,7 +49,10 @@ class ActiveRecordWithoutCallbacks
49
49
  begin
50
50
  #Run the given block, now that all callbacks are disabled.
51
51
  puts "Yielding block." if @debug
52
- return yield
52
+
53
+ klass.observers.disable :all do
54
+ return yield
55
+ end
53
56
  ensure
54
57
  puts "Restoring callbacks." if @debug
55
58
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active-record-without-callbacks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-08 00:00:00.000000000 Z
12
+ date: 2013-04-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -111,7 +111,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
111
111
  version: '0'
112
112
  segments:
113
113
  - 0
114
- hash: 1788919925078652095
114
+ hash: 2963953315244332504
115
115
  required_rubygems_version: !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements: