init.rb
# Settings more likely to need to be changed I've put nearer the top.
#
# At some point it would be good to define a full dsl, but I've got other
# things to do...
#
# These methods can be redefined in the block passed to the
# +automatic_resources+ method:
#
# automatic_resources :collection, :category, :item do
#   def finder_method_on_resource(resource)
#     case resource
#     when 'item'
#       'find'
#     else
#       'find_by_param!'
#     end
#   end
# end
#
Settings more likely to need to be changed I've put nearer the top.
At some point it would be good to define a full dsl, but I've got other
things to do

These methods can be redefined in the block passed to the
+automatic_resources+ method.


Settings more likely to need to be changed I ' ve put nearer the top . At some point it would be good to define a full dsl but I ' ve got other things to do These methods can be redefined in the block passed to the + automatic_resources + method .
def scope(resource)
    scope = nil
    if parent = parent_resource(resource)
      scope = send(self.class.finder_method_name_for_resource(parent))
      scope = scope.send(self.class.collection_method_on_resource(resource), false)
    else
      scope = self.class.class_for_resource(resource)
    end
    scopes = [*scope_names_for_resource(resource)].compact
    scope = scopes.inject(scope) do |result, scope_name|
      result.send(scope_name)
    end
    scope
  end
def scope ( resource ) scope = nil if parent = parent_resource ( resource ) scope = send ( self . class . finder_method_name_for_resource ( parent ) ) scope = scope . send ( self . class . collection_method_on_resource ( resource ) , false ) else scope = self . class . class_for_resource ( resource ) end scopes = [ * scope_names_for_resource ( resource ) ] . compact scope = scopes . inject ( scope ) do | result , scope_name | result . send ( scope_name ) end scope end
Settings more likely to need to be changed I've put nearer the top.
Settings more likely to need to be changed I ' ve put nearer the top .
resource
<not_specific>