我有屬於位置爲什麼會這樣返回NULL
>> r = Request.find 11210
=> #<Request id: 11210, artist: "Coldplay", song: "Amsterdam", venue: "someplace", showdate: "2011-02-23", amount: nil, user_id: 11, created_at: "2011-02-23 02:55:13", updated_at: "2011-03-24 02:55:13", like_reason: "Its Great", pledge: #<BigDecimal:1032f1850,'0.29E2',9(18)>, location_id: 243, charge_card: false, approval_key: nil, charged: false, paypal_email: "[email protected]">
>> r.location.showdate
=> Wed, 23 Feb 2011
>> r.showdate
=> Wed, 23 Feb 2011
>> Request.find_all_by_showdate(r.location.showdate)
=> []
>>
他們在DB兩個日期字段這個請求......
我目前使用SQLite如果有差別
如果您使用的是Rails3,Request.find_all_by_showdate(r.location.showdate).to_sql的輸出是什麼 – chris 2011-03-24 03:17:01