Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 183623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:08:56+00:00 2026-05-11T15:08:56+00:00

As described in this article , I am using automatic associations in fixtures. For

  • 0

As described in this article, I am using automatic associations in fixtures. For example, if a region object has a country id, instead of doing ‘country_id’: 1, I do ‘country’: ‘USA’. ‘USA’ is a label in my countries.yml file, so fixtures knows how to take care of this. However, this only works when you do not specify an ID value for the countries object. So I cannot assign USA’s ID to be 1. But if I do not assign it to be 1, it ends up being some large value 8974343…which is kinda strange. Is there a way to get fixtures to auto-generate id’s that are not super high? ….or is this ok?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T15:08:57+00:00Added an answer on May 11, 2026 at 3:08 pm

    Reading the API documentation, this is exactly how autogenerated fixtures are supposed to behave — if you want to have a specific ID value for a fixture in advance, you should probably just assign it yourself.

    If not, well, from the API docs:

    The generated ID for a given label is constant, so we can discover any fixture‘s ID without loading anything, as long as we know the label. 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the ASP.NET password hashing code example provided in this article. Its
I'm using a pattern as described by John Gruber in this daringfireball article to
For some reason, addAsync chaining in a flexunit test as described in this article
I am using the code as described in this question. However get following error
I am using the method described in this question to load intial users for
I'm implementing a colour picker component as described in this seminal article . As
After reading this article: Using Interfaces in C++ I have decided to use the
I am using Anthony Williams' fixed point library described in the Dr Dobb's article
I'm using PHP to create maintainable stylesheets, as described in the following article: http://www.barelyfitz.com/projects/csscolor/
I am using this article to create a dynamic path to save a file.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.