Answer the question
In order to leave comments, you need to log in
rails. How to remove (undefine) associations\relations?
Suppose we declare an association in a class:
class User < Activerecord::Base
has_many :posts
end
User.class_eval do
...
end
Answer the question
In order to leave comments, you need to log in
has_many is converted to a set of methods. You can try removing them, but there are quite a few of them. And in general, this is a dirty patching, it is better not to do this.
Explain the context of the task. Perhaps your problem can be solved in a much simpler way.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question