我有一个名为 GuestOrder 的模型:
class GuestOrder < ActiveRecord::Base
end
# == Schema Information
#
# Table name: guest_orders
#
# id :integer not null, primary key
# notes :string(255)
# adults :integer
# children :integer
# created :datetime
# placed :datetime
# billed :datetime
# user_id :integer
# guest_table_id :integer
# take_away_id :integer
# created_at :datetime
# updated_at :datetime
检索GuestOrders
where billed
isnil
效果很好:
GuestOrder.where(billed: nil)
但是我怎样才能检索GuestOrders
where billed
is not nil
?