I am trying to define two variables as follows:
@orders = Customer.find_all_by_order_date(nil)@nonorders = Customer.find_all_by_order_date(!nil)
The first works properly but the second doesn’t. How can I find those customers whose order_date fields are not nil?
@nonorders = @customer.orders.find(:all, :conditions => "@customer.orders.order_date IS NOT NULL")
is giving me the following error:
undefined method 'extract_options_from_args!' for ActiveRecord::Base:Class
I’ve tried changing the conditions, such as @orders.order_date, @customer.order.order_date, etc. What’s causing this error? Thank you!
Rails3:
Rails2: