Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #368 from unnu/master

ActiveRecord must not be loaded when using Mongoid backend
  • Loading branch information...
commit 7064b40f35b99ac5ee3de9338c7c495059fc3c4e 2 parents 1db8109 + 9ce8644
@betamatt betamatt authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/delayed/performable_method.rb
View
2  lib/delayed/performable_method.rb
@@ -9,7 +9,7 @@ class PerformableMethod
def initialize(object, method_name, args)
raise NoMethodError, "undefined method `#{method_name}' for #{object.inspect}" unless object.respond_to?(method_name, true)
- if object.kind_of?(ActiveRecord::Base)
+ if defined?(ActiveRecord) && object.kind_of?(ActiveRecord::Base)
raise(ArgumentError, 'Jobs cannot be created for records before they\'ve been persisted') if object.attributes[object.class.primary_key].nil?
end
Please sign in to comment.
Something went wrong with that request. Please try again.