Is it not possible to load fixtures with ID of 0? Is there a way to
force it?
TIA
Is it not possible to load fixtures with ID of 0? Is there a way to
force it?
TIA
Wouldn’t it just auto increment though?
Just don’t specify an ID at all.
On Jan 18, 2008 12:02 PM, Luke G.
[email protected]
wrote:
Is it not possible to load fixtures with ID of 0? Is there a way to
force it?TIA
Posted via http://www.ruby-forum.com/.
–
Ryan B.
Feel free to add me to MSN and/or GTalk as this email.
Just try it and find out for yourself.
Why would you want all fixtures with id=0 anyway?
On Jan 18, 2008 12:17 PM, Luke G.
[email protected]
wrote:
Wouldn’t it just auto increment though?
Posted via http://www.ruby-forum.com/.
–
Ryan B.
Feel free to add me to MSN and/or GTalk as this email.
The ID of a fixture record should actually be irrelevant. IMO you should
NEVER use ID as a basis for any part of your tests. There simply isn’t a
need and it leads to fragile tests almost every time. For instance
User.find(1) can be users(:something_useful)
if assigns(:user) == 34 can be if assigns(:user) == users(:some_user).id
In almost every case its clearer without the ID. In Rails 2 you don’t
even need to specify ID’s anymore and its about time.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs