Permalink
Browse files

AutoAdminController's doc mostly finished.

  • Loading branch information...
1 parent 0e35e2b commit 0153b5bf0350ea48e414a22657e7bf2ca3d2fafa @baldowl committed Aug 3, 2008
Showing with 8 additions and 1 deletion.
  1. +8 −1 lib/auto_admin_controller.rb
@@ -58,6 +58,9 @@ def user_history_includes
def user_history_identity
{ AutoAdmin::AutoAdminConfiguration.admin_model_id => (user && user.id) }
end
+
+ # Returns the latest +num+ records from the +admin_histories+ table; they're
+ # usually displayed in the "index" view by the active theme.
def user_history_items(num=10)
conditions = []
condition_values = []
@@ -91,6 +94,8 @@ def logout
redirect_to :action => 'index'
end
+ # Ancillary class used to scour the administered model for related class and
+ # collect the results
class AssociationCollector
attr_reader :model, :associations
def initialize(model)
@@ -106,6 +111,9 @@ def collect_associations_for_model
collector.associations
end
private :collect_associations_for_model
+
+ # Handles the basic listing view, creatively building the +find+ options
+ # object from the request parameters.
def list
params[:filter] ||= {}
params[:filter] = model.filter_defaults.merge(params[:filter])
@@ -292,4 +300,3 @@ def asset
send_file filename, :type => mime_type
end
end
-

0 comments on commit 0153b5b

Please sign in to comment.