Git Product home page Git Product logo

Comments (2)

germsvel avatar germsvel commented on May 28, 2024

Thanks for opening the issue @LandonSchropp! Currently, sequences use Agents to hold the state for the sequence. Your suggestion means we'd have to switch to saving the state in some other way. I'm not sure how we would be accomplish that. But if you have ideas, I'd be happy to review a pull-request.

In the meantime, I know it's probably not ideal, but you could modify the factory when you do manual testing to pass the start_at option to the sequence. You can see that in the sequence docs:

def user_factory do
  %{
    # Will generate "[email protected]" then "[email protected]", etc.
    email: sequence(:email, &"me-#{&1}@foo.com", start_at: 100),
  }
end

Do you think that would help?

from ex_machina.

LandonSchropp avatar LandonSchropp commented on May 28, 2024

Thanks for the reply @germsvel! Your suggestion is definitely helpful in quickly solving my problem. 🙂

What I've done in the past with Fabricator in Ruby was to patch the sequence generator and store the index to a temp file on every index generation. When the Fabricator first loaded, I would read the last sequence index from the disk and start it there.

I totally understand if this isn't something you're interested in adding to your package. I realize this isn't standard usage for factories—although it's useful!—so I'm content in closing this if you feel like it's out of scope.

If it's functionality you're interested in, I'm happy to create a draft PR around it.

Thanks!

from ex_machina.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.