Created
March 17, 2011 16:37
-
-
Save peterdietz/874637 to your computer and use it in GitHub Desktop.
some screwy ruby code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scope = Contact.scoped({}) | |
scope = scope.in_project(@project.id) if @project | |
scope = scope.visible unless @project | |
scope = scope.tagged_with(params[:tag]) unless params[:tag].blank? | |
scope = scope.scoped :conditions => cond.conditions | |
if pages | |
@contacts_pages = Paginator.new(self, scope.count, 20, params[:page]) | |
offset = @contacts_pages.current.offset | |
limit = @contacts_pages.items_per_page | |
scope = scope.scoped :limit => limit, :offset => offset if @contacts_pages.count > 1 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment