This project is archived and is in readonly mode.
exists? should not instantiate a record
-
Jeff Kreeftmeijer
Automatic cleanup of spam.
-
Cesario
@Jose: i wanted to work on that but I can't reproduce it with
def test_exists_with_scopes assert_nothing_raised do authors(:david).posts.containing_the_letter_a.exists?(:title => 'Welcome to the weblog') end endwith current Rails' master. This test just passes.
Am I testing it right or is this bug solved?
-
José Valim
It seems your test is right. Is Author doing has_many :posts and Post doing belongs_to :author or they are passing additional arguments? Have you checked if that piece of the code I mentioned above is being called?
Thanks for looking into this!
-
Cesario
There's an extension on the
belong_to :authorassociation but nothing more than that.
Yes the piece of code you mention is being called.
About the published attribute you put in the code, are you sure it is stored at the children level? -
José Valim
Yes, it is at the child level. But I just checked again and found out that my "comments" has a include clause, like this:
class Post has_many :comments, :include => :comment_author endSo it is quite likely that it is this other include that is making it fail?
-
Cesario
No luck in trying to reproduce that one unfortunately. :/
-
rails
- State changed from new to open
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.
Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.
-
rails
- State changed from open to stale