When you define an association in Rails, it creates some methods on that association for you. For example, consider the following:
class Person
has_many :friends
end
One of the methods you get is person.friends.clear
How can I remove this method such that person.friends.clear would raise a NoMethodError?
Note: I have tried a few things, including undef_method and remove_method without luck. Please only provide known answers and not guesses.
Though I didnt try it myself but could would pls check if the following works