mirror of
https://github.com/drapergem/draper
synced 2023-03-27 23:21:17 -04:00
Merge pull request #460 from carloslopes/decorated-collection
Add #decorated? method to CollectionDecorator
This commit is contained in:
commit
bbcc35cd8b
2 changed files with 13 additions and 0 deletions
|
@ -70,6 +70,11 @@ module Draper
|
|||
@decorator_class ||= self.class.inferred_decorator_class
|
||||
end
|
||||
|
||||
# @return [true]
|
||||
def decorated?
|
||||
true
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
# @return the collection being decorated.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue