I am trying to re-open a class in Rails that comes from an engine. I did the following:
module Xaaron
ApiKey.class_eval do
include Promiscuous::Publisher
publish :xaaron_users_id, :api_key, :as => :ApiKey
end
end
which sits in:
models/
Xaaron/
api_key.rb
This is all in my app, which should then let me run:
bundle exec promiscuous publish "Xaaron::ApiKey.all"
But, when I do, I get the error:
RuntimeError: Circular dependency detected while autoloading constant Xaaron::ApiKey
Like @artemave stated, rename the file. And if that does not work, try: