我在這裏面臨一個小問題。 我取使用下面的代碼數據的數據,布爾驗證
class CreateGrounddetails < ActiveRecord::Migration
def change
create_table :grounddetails do |t|
t.string :name
t.datetime :working_hours
t.string :address
t.string :contact_no
t.string :email
t.integer :number_of_grounds
t.text :description
t.boolean :featured_ground #Featured
t.timestamps null: false
end
end
end
我有一個存儲在域「featured_ground」一個布爾值,現在我想只獲取其是否有「featured_ground「真」值數據」。 我該如何做到這一點?
預先感謝您。
檢查生成的SQL我想有地面我period..how能做到這一點是一定時間真? –