Skip to content

Commit

Permalink
Applying patch from gregbell#1896
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansch committed Feb 18, 2013
1 parent 71bfbd1 commit 155dad0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/active_admin/resource_controller/decorators.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def resource
def active_admin_collection
decorator = active_admin_config.decorator_class
collection = super
decorator ? decorator.decorate(collection) : collection
decorator ? decorator.decorate_collection(collection) : collection
end
end
end
Expand Down
12 changes: 6 additions & 6 deletions spec/support/templates/post_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
class PostDecorator < SimpleDelegator
delegate :id, :to => :__getobj__

def self.decorate(collection_or_object)
if collection_or_object.respond_to?(:to_ary)
DecoratedEnumerableProxy.new(collection_or_object)
else
new(collection_or_object)
end
def self.decorate(object)
new(object)
end

def self.decorate_collection(collection)
DecoratedEnumerableProxy.new(collection)
end

def self.model_name
Expand Down

0 comments on commit 155dad0

Please sign in to comment.