1

I have a class that looks like this:

module API
  module MyNamespace
    class Base < ActiveRecord::Base
    end
  end
end

module API
  module MyNamespace
    class MyClass < Base
    end
  end
end

When trying to upgrade from ruby 1.9.3 to 2.1.5, I started getting an error when executing the entire spec suite.

superclass must be a Class (Module given)

This is strange, because API::MyNamespace::Base is a class. Also if I run the tests as part of a smaller run (individual spec, or everything in the API namespace), then everything is fine.

I'm not really sure what to try here.

DVG
  • 17,392
  • 7
  • 61
  • 88
  • 1
    I think I hit this once and it's stupid. I think I changed it from actually using the words `module API` etc to just doing `class API::MyNamespace::MyClass` and it was happier with that (even though they're logically equivalent) – Taryn East May 07 '15 at 23:45
  • Giving that a go right now, will report back. – DVG May 08 '15 at 11:52
  • 1
    That did it! Odd. Make that an answer and I'll upvote/accept! – DVG May 08 '15 at 14:16

1 Answers1

3

I think I hit this once and it's stupid. I think I changed it from actually using the words module API etc to just doing

class API::MyNamespace::MyClass

and it was happier with that (even though they're logically equivalent)

Taryn East
  • 27,486
  • 9
  • 86
  • 108