2012-04-10 7 views
0

Gibt es eine Möglichkeit, in Paginate mit Rules 2.3 mit_exclusive_scope paginieren?Paginieren mit Verwendung von exclusive_scope

@albums = Album.paginate(:page => 1, :per_page => 12, :conditions => cond) 

funktioniert gut.

Album.with_exclusive_scope {find(:all, :conditions => cond)} 

funktioniert gut.

Können wir mit_exclusive_scope und paginate kombinieren?

Antwort

0

@albums = Album.find_allx (opts) .paginate (: Seite => 1: per_page => 12)

with_exclusive_scope ist ein geschütztes Verfahren, so dass es aus einer Klasse Nachricht aufgerufen werden muss. In diesem Fall lautet die Klassenmethode find_allx()