This project is archived and is in readonly mode.
[PATCH] Generate fixture data for empty models
Reported by Sam Ruby | December 11th, 2009 @ 06:37 PM | in 3.0.2
In Agile Web Development with Rails, Edition Four, I'm intending to define a Cart model thus:
class Cart < ActiveRecord::Base
has_many :line_items, :dependent=>:destroy
end
So I start off easily enough:
ruby script/generate scaffold cart
This generates both a
test/functional/carts_controller_test.rb
and a
test/fixtures/carts.yml
. Unfortunately, the generated
tests will not pass as generated as there are no fixtures name
one
and two
, nor is there even an
indication of what needs to be done in the fixture itself.
I figured I could explain this in the book, or I could simply provide a patch to eliminate the need to explain this, and hence the patch.
Comments and changes to this ticket
-
Repository December 18th, 2009 @ 01:53 AM
- State changed from new to committed
(from [44fb54fecdab684425bbc3bb15aac9d5c6e34fc8]) Models with no attributes should just have empty hash fixtures [Sam] (Closes #3563) http://github.com/rails/rails/commit/44fb54fecdab684425bbc3bb15aac9...
-
Repository December 18th, 2009 @ 01:53 AM
(from [8bb3b9bcffae0675fcf3cd2d05870de03aa31397]) Models with no attributes should just have empty hash fixtures [Sam] (Closes #3563) http://github.com/rails/rails/commit/8bb3b9bcffae0675fcf3cd2d05870d...
-
Jeremy Kemper October 15th, 2010 @ 11:01 PM
- Milestone set to 3.0.2
- Importance changed from to Low
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 3563 [PATCH] Generate fixture data for empty models (from [44fb54fecdab684425bbc3bb15aac9d5c6e34fc8]) Models ...
- 3563 [PATCH] Generate fixture data for empty models (from [8bb3b9bcffae0675fcf3cd2d05870de03aa31397]) Models ...