Search code examples
ruby-on-railsrails-spring

Rails: How to redefine a Class


I am trying to use Spring in my rails project but I have my own class called Spring that inherits from another class of mine called Feature.

In my code I call .superclass on a variable that is set to Spring sometimes. It fails because the variable is set to the other Spring class. How can I set it to class I defined?


Solution

  • i would suggest use modules. create your class inside a module and call it MyModule::Spring to avoid conflicts