diff --git a/lib/draper/collection_decorator.rb b/lib/draper/collection_decorator.rb index dc66296..ad28a6c 100644 --- a/lib/draper/collection_decorator.rb +++ b/lib/draper/collection_decorator.rb @@ -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. diff --git a/spec/draper/collection_decorator_spec.rb b/spec/draper/collection_decorator_spec.rb index 756514b..aefc182 100644 --- a/spec/draper/collection_decorator_spec.rb +++ b/spec/draper/collection_decorator_spec.rb @@ -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