Skip to content

allow users to access derived fixture names #45

@thewoolleyman

Description

@thewoolleyman

Either somehow directly expose the generated name as soon as the record is created, or expose the logic to generate names.

This will allow users to use the fixture name to store hash of created instances by name, and reference them to provide as associated objects when creating subsequent fixtures which have a dependency on them, without having to manually assign a local variable to track the instance, or manually assign a name or naming block when the built-in automatic naming would work fine.

E.g.:

users = [Factory(:user, :name => "david")]
models[:user] = users.map{|u| fbuilder.fixture_name_for(u)}
Factory(:purchase, user: models[:user][:david])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions