Hi Guido,
Mit Rails 3 bzw. Arel und ohne SQL-Schnipsel:
Playday.where(
Playday.arel_table[:play_date].gteq(Date.new(2010, 11, 1)).and(
Playday.arel_table[:play_date].lt(Date.new(2010, 12, 1))
)
)
Viele Grüße,
Till
Am 14.12.2010 um 18:26 schrieb Guido Pesch:
> Hallo Liste,
>
> stehe gearde völlig auf der Leitung.
>
> Habe ein Model "Playday"
> mit einem attribut play_date (Typ Date)
>
> ich möchte nun eine query absetzen, die mir alle
> Playdays liefert wo das Jahr zb. 2010 ist und der Monat 11 (november)
>
> ich kriege die condition nicht hin.
>
> danke und Gruß
> Guido
> _______________________________________________
> rubyonrails-ug mailing list
> [email protected]
> http://mailman.headflash.com/listinfo/rubyonrails-ug
Till Schulte-Coerne, [email protected], http://www.innoq.com
innoQ Deutschland GmbH, Halskestr. 17, D-40880 Ratingen, Germany
_______________________________________________
rubyonrails-ug mailing list
[email protected]
http://mailman.headflash.com/listinfo/rubyonrails-ug