paulelliott/fabrication — pull request #97 by knwang (2012-04-04 04:57:26+00:00)
Title: Memoize both singular and collection objects

Currently the generated fabrication cucumber steps always memoize generated objects with fabricator name, regardless it is one or many objects with this logic:

instance_variable_set("@#{fabricator.model}", @they)

This has several issues:

- if a collection of books is to be fabricated, they would be memoized as @book
- if one book is fabricated (for example using "Given 1 book"), the current code memoizes [ the_book_object ] to @book