ブログエンジンにRailsを使用しています。投稿が公開された月と年のユニークなアーカイブ機能を実装しています。ブログアーカイブの別の日付を選択する
ここでキュウリの機能です:
Scenario: Displaying an archive menu from distinct posts months and years
Given the following posts exists for the blog "Blondinbella":
| Title | Published at |
| Redbull | 1 March 2010 11:00 |
| Tuesday outfit | 2 January 2010 11:00 |
| Monday outfit | 1 January 2010 11:00 |
| Another outfit | 1 December 2009 11:00 |
When I visit the blog "Blondinbella"
Then I should see "March 2010" in the archive menu
And I should see "January 2010" in the archive menu
And I should see "December 2009" in the archive menu
But I should not see "February 2010" in the archive menu
は、私は、このための最良のアプローチを考え出す苦労しています。私はSQLの質問でハードコアに行かなければならないとすれば、それはどのように見えるだろうか? (PostgreSQLの使用)
純粋なRailsを使用するだけで、これをスムーズに行う方法はありますか?
SQLクエリを使用するには」だろうハードコア "? – araqnid