Skip to content

Commit

Permalink
Added #decorated? method to Draper::CollectionDecorator
Browse files Browse the repository at this point in the history
Closes #447
  • Loading branch information
carloslopes committed Feb 6, 2013
1 parent ea27146 commit 65e3c4e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/draper/collection_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ def decorator_class
@decorator_class ||= self.class.inferred_decorator_class
end

# @return [true]
def decorated?
true
end

protected

# @return the collection being decorated.
Expand Down
8 changes: 8 additions & 0 deletions spec/draper/collection_decorator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -255,5 +255,13 @@ module Draper
end
end

describe '#decorated?' do
it 'returns true' do
decorator = ProductsDecorator.new([Product.new])

expect(decorator).to be_decorated
end
end

end
end

0 comments on commit 65e3c4e

Please sign in to comment.