[Rails] [ANN] Where Plugin
Leon Leslie
leonleslie at gmail.com
Sun Jan 1 12:41:52 GMT 2006
When i use pagination it is still ugly.
> where = InVisible::Where.new( [[ :first, "Jens-Christian"], [ :last,
> "Fischer" ] ] )
> where.add( [ [ :age, :gt, 30 ] ] )
> where.add( [ [ :city, :like, "Zur%" ] ] )
@address_pages, @addresses = paginate :address,
:conditions => where.build_where_clause, :per_page => 10, :order_by
=> 'first'
How can I hide and clean up my code when using pagination.
l
On 1/1/06, Leon Leslie <leonleslie at gmail.com> wrote:
>
> Happy new Year Jens-Christian,
>
> I am considering this a new years gift.... That was quick...
>
> Thanks Rick for the idea....
>
> l
>
>
> On 12/31/05, Jens-Christian Fischer <jcf at invisible.ch> wrote:
>
> > > I'm not crazy about that API at all. Why not hide all that from me
> > > and let me do:
> > >
> > > Model.find_with_conditions(:all, :order => ....) do |where|
> > > where << [:age, :gt, 30]
> > > where << [:city, :like, "Zur%"]
> > > end
> >
> > I just updated the plugin to allow for this case. ( And I dropped the
> > requirement for the :gt, :lt etc symbols (just use '<', '>', etc.) )
> >
> > happy new year
> > jc
> >
> >
> > --
> > InVisible GmbH, Langgrütstrasse 172, 8047 Zürich
> > Phone: +41 44 401 09 30
> > http://www.invisible.ch http://not.invisible.ch
> >
> >
> >
> > _______________________________________________
> > Rails mailing list
> > Rails at lists.rubyonrails.org
> > http://lists.rubyonrails.org/mailman/listinfo/rails
> >
> >
> >
> >
>
>
> --
> First they laugh at you, then they ignore you, then they fight you.
> Then you win.
> -- Mahatma Karamchand Gandhi
--
First they laugh at you, then they ignore you, then they fight you.
Then you win.
-- Mahatma Karamchand Gandhi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060101/6ba74d30/attachment.html
More information about the Rails
mailing list