lib/scaffolding_extensions/meta_model.rb
# Return all records that match the given phrase (usually a substring of
# the most important column).  If options[:association] is present, delegate to the associated
# class's scaffold_auto_complete_find.
#
# Allows method override (options.delete(:association))
Return all records that match the given phrase (usually a substring of
the most important column).  If options[:association] is present, delegate to the associated
class's scaffold_auto_complete_find.


Return all records that match the given phrase ( usually a substring of the most important column ) . If options [ : association ] is present delegate to the associated class ' s scaffold_auto_complete_find .
def scaffold_auto_complete_find(phrase, options = {})
    session = options.delete(:session)
    if association = options.delete(:association)
      if meth = scaffold_method_override(:auto_complete_find, association, phrase, options)
        meth.call
      else
        scaffold_associated_class(association).scaffold_auto_complete_find(phrase, :session=>session)
      end
    else
      find_options = { :limit => scaffold_auto_complete_results_limit,
          :conditions => [scaffold_auto_complete_conditions(phrase), scaffold_session_conditions(session)],
          :order => scaffold_select_order(:auto_complete),
          :include => scaffold_include(:auto_complete)}.merge(options)
      scaffold_get_objects(find_options)
    end
  end
def scaffold_auto_complete_find ( phrase , options = { } ) session = options . delete ( :session ) if association = options . delete ( :association ) if meth = scaffold_method_override ( :auto_complete_find , association , phrase , options ) meth . call else scaffold_associated_class ( association ) . scaffold_auto_complete_find ( phrase , :session => session ) end else find_options = { :limit => scaffold_auto_complete_results_limit , :conditions => [ scaffold_auto_complete_conditions ( phrase ) , scaffold_session_conditions ( session ) ] , :order => scaffold_select_order ( :auto_complete ) , :include => scaffold_include ( :auto_complete ) } . merge ( options ) scaffold_get_objects ( find_options ) end end
Return all records that match the given phrase (usually a substring of
the most important column).
Return all records that match the given phrase ( usually a substring of the most important column ) .
phrase
<not_specific>
options
<not_specific>