[Rails] Re: Strange behaviour with ActiveRecord has_many collections, Rails 4 compared to Rails 3

2013-10-22 Thread Frederick Cheung
On Monday, October 21, 2013 4:37:22 PM UTC+1, Neil Williams wrote: Hi Fred, Thanks for your reply. Using new in this way isn't something I've come across in quite a few years of using rails. How would you initialise a new Task object given you have the @story instance available to

[Rails] Re: Strange behaviour with ActiveRecord has_many collections, Rails 4 compared to Rails 3

2013-10-22 Thread Neil Williams
Hi Fred, Thanks for this. yes I can understand why it has never been a problem. It won't be too much of a problem for us either, as the collection variable e.g. @tasks, would normally be filtered with .where() or be ordered with .order(), therefore, they would be different instances. But I

[Rails] Re: Strange behaviour with ActiveRecord has_many collections, Rails 4 compared to Rails 3

2013-10-21 Thread Frederick Cheung
On Monday, October 21, 2013 11:28:22 AM UTC+1, Neil Williams wrote: Hi All, I have been told to post discussion based topic on here instead of the GitHub Issues. I thought this 'could' be a bug, but just need some clarification really. The issue I posted is here

[Rails] Re: Strange behaviour with ActiveRecord has_many collections, Rails 4 compared to Rails 3

2013-10-21 Thread Neil Williams
Hi Fred, Thanks for your reply. Using new in this way isn't something I've come across in quite a few years of using rails. How would you initialise a new Task object given you have the @story instance available to you? @task = Task.new(:story_id = @story.id)? If the above, I really