lib/scaffolding_extensions/meta_model.rb
# Separate method for browsing objects, as it also needs to return whether or not there is another
# page of objects.  Returns [another_page, objects], where another_page is true or false.
Separate method for browsing objects, as it also needs to return whether or not there is another
page of objects.  Returns [another_page, objects], where another_page is true or false.
Separate method for browsing objects as it also needs to return whether or not there is another page of objects . Returns [ another_page objects ] where another_page is true or false .
def scaffold_browse_find_objects(options)
    get_options = {:order=>scaffold_select_order(:browse), :include=>scaffold_include(:browse), :conditions=>scaffold_session_conditions(options[:session])}
    if limit = scaffold_browse_records_per_page
      get_options[:offset] = (options[:page].to_i-1) * limit
      get_options[:limit] = limit = limit + 1
    end
    objects = scaffold_get_objects(get_options)
    if limit && objects.length == limit
      objects.pop
      [true, objects]
    else
      [false, objects]
    end 
  end
def scaffold_browse_find_objects ( options ) get_options = { :order => scaffold_select_order ( :browse ) , :include => scaffold_include ( :browse ) , :conditions => scaffold_session_conditions ( options [ :session ] ) } if limit = scaffold_browse_records_per_page get_options [ :offset ] = ( options [ :page ] . to_i - 1 ) * limit get_options [ :limit ] = limit = limit + 1 end objects = scaffold_get_objects ( get_options ) if limit && objects . length == limit objects . pop [ true , objects ] else [ false , objects ] end end
Separate method for browsing objects, as it also needs to return whether or not there is another
page of objects.
Separate method for browsing objects as it also needs to return whether or not there is another page of objects .
options
<not_specific>