Skip to content
Browse files

Coerce source to array before freezing

  • Loading branch information...
1 parent b96e318 commit 9eb9fc909c372ea1c2392d05594fa75a5c08b095 @haines haines committed Dec 27, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/draper/collection_decorator.rb
View
2 lib/draper/collection_decorator.rb
@@ -16,7 +16,7 @@ class CollectionDecorator
# @option options [Hash] :context context available to each item's decorator
def initialize(source, options = {})
options.assert_valid_keys(:with, :context)
- @source = source.dup.freeze
+ @source = source.to_a.dup.freeze
@decorator_class = options[:with]
@context = options.fetch(:context, {})
end

0 comments on commit 9eb9fc9

Please sign in to comment.
Something went wrong with that request. Please try again.