insque 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/lib/insque/version.rb +1 -1
  2. data/lib/insque.rb +4 -5
  3. metadata +1 -1
@@ -1,3 +1,3 @@
1
1
  module Insque
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
data/lib/insque.rb CHANGED
@@ -118,11 +118,10 @@ if defined?(ActiveRecord::Base)
118
118
  options = args.extract_options!
119
119
  excluded = (options[:exclude] || []).map(&:to_s)
120
120
 
121
- [:update, :create, :destroy].each do |action|
122
- set_callback :commit, :after, on: action do
123
- params = self.serializable_hash(options).delete_if {|key| (['created_at', 'updated_at'] + excluded).include? key}
124
- Insque.broadcast :"#{self.class.to_s.underscore}_#{action}", params
125
- end
121
+ set_callback :commit, :after do
122
+ action = [:create, :update, :destroy].map {|a| a if transaction_include_action?(a) }.compact.first
123
+ params = self.serializable_hash(options).delete_if {|key| (['created_at', 'updated_at'] + excluded).include? key}
124
+ Insque.broadcast :"#{self.class.to_s.underscore}_#{action}", params
126
125
  end
127
126
  end
128
127
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: insque
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: