{"action":"created","issue":{"url":"https://api.github.com/repos/resque/resque/issues/1365","labels_url":"https://api.github.com/repos/resque/resque/issues/1365/labels{/name}","comments_url":"https://api.github.com/repos/resque/resque/issues/1365/comments","events_url":"https://api.github.com/repos/resque/resque/issues/1365/events","html_url":"https://github.com/resque/resque/issues/1365","id":123243491,"number":1365,"title":"\"Stack level too deep\" when passing a Class as an argument to Resque.enqueue","user":{"login":"mikemarsian","id":184810,"avatar_url":"https://avatars.githubusercontent.com/u/184810?v=3","gravatar_id":"","url":"https://api.github.com/users/mikemarsian","html_url":"https://github.com/mikemarsian","followers_url":"https://api.github.com/users/mikemarsian/followers","following_url":"https://api.github.com/users/mikemarsian/following{/other_user}","gists_url":"https://api.github.com/users/mikemarsian/gists{/gist_id}","starred_url":"https://api.github.com/users/mikemarsian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikemarsian/subscriptions","organizations_url":"https://api.github.com/users/mikemarsian/orgs","repos_url":"https://api.github.com/users/mikemarsian/repos","events_url":"https://api.github.com/users/mikemarsian/events{/privacy}","received_events_url":"https://api.github.com/users/mikemarsian/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/resque/resque/labels/Bug","name":"Bug","color":"ff0000"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-21T09:46:49Z","updated_at":"2016-01-18T20:42:51Z","closed_at":"2016-01-18T20:42:51Z","body":"If ActiveRecord is required in my gem project, than calling ```Resque.enqueue``` with a Class object as an argument produces the following error:\r\n```\r\nSystemStackError:\r\n       stack level too deep\r\n     # /home/mike/.rvm/gems/ruby-1.9.3-p551/gems/activerecord-3.2.11/lib/active_record/scoping.rb:130\r\n```\r\n\r\nTo avoid the bug, all is needed is to make sure we don't pass Class object to ```Resque.enqueue``` as argument, and instead pass a String (by calling ```Resque.enqueue(Serially::Worker, item_class.to_s, item_id)``` instead of: https://github.com/mikemarsian/serially/blob/v0.1.0-resque_bug/lib/serially/worker.rb#L44\r\n\r\nHere's the project tag, which demonstrates the issue (after cloning and running bundle, simply run 'rake' to run tests, and see the problem): https://github.com/mikemarsian/serially/releases/tag/v0.1.0-resque_bug"},"comment":{"url":"https://api.github.com/repos/resque/resque/issues/comments/172648407","html_url":"https://github.com/resque/resque/issues/1365#issuecomment-172648407","issue_url":"https://api.github.com/repos/resque/resque/issues/1365","id":172648407,"user":{"login":"steveklabnik","id":27786,"avatar_url":"https://avatars.githubusercontent.com/u/27786?v=3","gravatar_id":"","url":"https://api.github.com/users/steveklabnik","html_url":"https://github.com/steveklabnik","followers_url":"https://api.github.com/users/steveklabnik/followers","following_url":"https://api.github.com/users/steveklabnik/following{/other_user}","gists_url":"https://api.github.com/users/steveklabnik/gists{/gist_id}","starred_url":"https://api.github.com/users/steveklabnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steveklabnik/subscriptions","organizations_url":"https://api.github.com/users/steveklabnik/orgs","repos_url":"https://api.github.com/users/steveklabnik/repos","events_url":"https://api.github.com/users/steveklabnik/events{/privacy}","received_events_url":"https://api.github.com/users/steveklabnik/received_events","type":"User","site_admin":false},"created_at":"2016-01-18T20:42:51Z","updated_at":"2016-01-18T20:42:51Z","body":"Okay! I'm going to give this one a close, then."}}