insque 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/insque/version.rb +1 -1
- data/lib/insque.rb +4 -5
- metadata +1 -1
data/lib/insque/version.rb
CHANGED
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
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
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
|