
Adding a relationship to a model with a cached relationship...
Reported by Mike (at coverallcrew) | July 6th, 2009 @ 04:28 PM
If we access a relationship from a model and later on try to add a new relationship to that model we get the results of the first access of the model.
Code attached to demonstrate.
Mike.
Comments and changes to this ticket
-
Martin Gamsjaeger (snusnu) July 21st, 2009 @ 05:38 PM
- State changed from new to confirmed
I can confirm the above described behavior on latest next branch. However, I'm not really sure wether this is a bug or not. Another (and probably more idiomatic) way to write the above actually works as expected. (This assumes current next branch)
puts '------- This works -------------------------------------' person = Person.new(:name => 'This is a person') person.save puts "\tPerson: \t\t" + person.inspect person.things.new(:person => person, :name => 'Something...') person.save puts "\tThing: \t\t" + person.things.last.inspect puts "\tPerson's Things: \t" + person.things.inspect person.things.new(:person => person, :name => 'Something else...') person.save puts "\tThing: \t\t" + person.things.last.inspect puts "\tPerson's Things: \t" + person.things.inspect
-
Dan Kubb (dkubb) July 22nd, 2009 @ 03:56 PM
- State changed from confirmed to accepted
-
Dan Kubb (dkubb) October 4th, 2009 @ 09:33 PM
- Milestone changed from 0.10.0 to 0.10.2
[project:id#20609 not-tagged:"0.10.0" milestone:id#51895 bulk edit command]
-
Dan Kubb (dkubb) February 1st, 2010 @ 04:33 PM
- Milestone changed from 0.10.2 to 1.0.0
-
-
-
Dan Kubb (dkubb) February 2nd, 2010 @ 02:47 AM
- State changed from accepted to confirmed
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »