私はRails 3.1で予約システムを開発しています。 - 同じproduct_idを持つ別の予約の任意の期間をオーバーラップさRails 3.1での期間の扱い
# == Schema Information
#
# Table name: bookings
#
# id :integer not null, primary key
# product_id :integer
# customer_id :integer
# booked_from :datetime
# booked_to :datetime
# paid :boolean
# payment_type :string(255)
# created_at :datetime
# updated_at :datetime
#
だから私がやりたいことは、各エントリを検証し、所望の時間(booked_to booked_fromが)かどうかをチェックすることです:私は予約のためのモデルを作成しました。製品にはavailable_fromおよびavailable_toフィールドもあり、これも検証する必要があります。
どうすればよいですか?
関連:http://stackoverflow.com/questions/5028612/reservation-type-system-w-validation-rails-3-0/5030662#5030662 – Dogbert
ありがとうございました。 – samuel02