This project is archived and is in readonly mode.

#5562 ✓resolved
Alexis Toulotte

Build model from association with conditions

Reported by Alexis Toulotte | September 6th, 2010 @ 09:24 AM

Building a model from an association does not set attributes from conditions.:

>> Post.first.comments.where(:author => "John").build.author
=> nil

But from model directly it does:

>> Comment.where(:author => "John").build.author
=> "John"

Comments and changes to this ticket

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>

Referenced by

Pages