Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Associations now raises `ArgumentError` on name conflicts. #13896
It's an attempt to fix #13217.
In order to avoid unexpected behavior, dangerous association names should raise
This way, models like this:
class Project < ActiveRecord::Base has_many :errors end # It was deleting all the errors when saving, # because the valid? method calls errors.clear. # see https://github.com/rails/rails/blob/master/activemodel/lib/active_model/validations.rb#L312-L314