This project is archived and is in readonly mode.
ActiveRecord::HasManyThroughCantAssociateThroughHasManyReflection being thrown when calling destroy_all on a :has_many :through association
Reported by Olly Headey | May 21st, 2009 @ 01:04 PM | in 2.x
As of this commit, calling
destroy_all
on a :has_many :through
association raises an
ActiveRecord::HasManyThroughCantAssociateThroughHasManyReflection
exception. This wasn't the case before this commit.
e.g. Given:
class Company
has_many :projects, :through => :contacts
end
Calling company.projects.destroy_all
results
in:
ActiveRecord::HasManyThroughCantAssociateThroughHasManyReflection: Cannot modify association 'MyClass#projects' because the source reflection class 'Project' is associated to 'Contact' via :has_many
Calling company.projects.all.destroy_all
works,
however.
Comments and changes to this ticket
-
Olly Headey May 22nd, 2009 @ 03:48 PM
Please ignore (or delete) this ticket. Instead I have added a comment in the correct place (https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets....
I would delete it myself but there doesn't seem to be an option to do so.
-
CancelProfileIsBroken May 22nd, 2009 @ 05:28 PM
- State changed from new to invalid
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>