Thank you Juan and Colin.
One thing I didn't mention is that canceled_time comes from different
class where the relationship is:
class CourseDate < ActiveRecord::Base
class CourseLesson < ActiveRecord::Base
so in the query:
@course = CourseDate.find_all_by_date_and_canceled_time(Date.today,nil)
'date' is in table 'course_dates'
'canceled_time' is in table 'course_lessons'
So the suggested:
CourseDate.where(:date => Date.today, :canceled_time => nil)
did not work (thanks Juan)
But I'm getting all records for today (and their related lessons),
eventhogh one of the records has its 'canceled_time' set with time. I'm
of course expecting to get only those records with 'canceled_time' not
I'm using rails 3+
Colin, scope names looks elegant and I'll use it, but first I would like
to get my original query working.
Any hints how ?