same site with 3.0.10 and the same issue pops out.
Lets say we have a Classified site, so we have ads and pictures:
class Ad < ActiveRecord::Base
scope :active, where("expires_on > now()")
scope :unsold, where("sold = 0")
scope :approved, where("status = "approved")
class Picture < ActiveRecord::Base
Now lets run some tests and try to explain myself:
Ad.unsolds.to_sql=> "SELECT `ads`.* FROM `ads` WHERE (sold = 0) ORDER BY ads.created_at
Ad.there_is_no_scope.unsolds.to_sql=> NoMethodError: undefined method `there_is_no_scope' for #<Class:
Awesome. Now comes the issue
I have 1.6M of records in my ads table, obviously I noted some kind of
hanging, the problem was,
Ad.includes(:picture).there_is_no_scope.unsolds.to_sql raise the
NoMethodError but also executes the query defined before the missing
scope, in this case "select * from ads".
I can create an example application if this is not understandable.
Just want you guys to know about this issue.
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to email@example.com.
To unsubscribe from this group, send email to firstname.lastname@example.org.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.