2012-04-10 3 views
0

레일즈 2.3에서 with_exclusive_scope를 사용하여 페이지 매김 할 수있는 방법이 있습니까?With_exclusive_scope를 사용하여 페이지 매기기

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

잘 작동합니다.

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

잘 작동합니다.

with_exclusive_scope와 페이지 매김을 결합 할 수 있습니까?

답변

0

@albums = Album.find_allx (OPTS) .paginate (: 페이지 => 1 : per_page => 12)는 클래스 메시지 호출되어야하므로

with_exclusive_scope는 보호 방법이다. 이 경우 클래스 메서드는 find_allx()

입니다.