Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue 1858 : upgrading to Draper 1.0 #1896

Merged
merged 1 commit into from
Mar 4, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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