lib/cleo.rb in acts_as_cleo-2.4.1 vs lib/cleo.rb in acts_as_cleo-2.4.2
- old
+ new
@@ -4,9 +4,10 @@
#define delete, update, create dynamically in order to set up reddis backed calls if enabled
#Cleo.update(obj) will respect async settings
%w{delete update create}.each do |mn|
define_singleton_method(mn.to_s) do |obj|
if Cleo::Server.async?
+ obj_id = obj.is_a?(Fixnum) ? obj : obj.id
Resque.enqueue(Cleo::Processor, mn, obj.record_type.classify, obj.id)
else
Cleo.send("execute_#{mn}".to_sym, obj)
end
end