Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Use variables in seed files #124

@garethfr

Description

@garethfr

Is it possible to use variables in seed files?

For example use admin_email variable as follows:

owner_id: "<%= sprig_record(User, admin_email).id %>"

This will allow me to use a different value in dev / staging / prod environments.

I know I can create different seed files for each environment, but I want to avoid duplicating the data when only one field is different.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions