Allow folks a way to define an argument on a factory #88

Open
opened 2024-06-05 13:42:40 +12:00 by james · 0 comments
Owner
 factory MyApp.Accounts.User do
    attribute :email, &Faker.Internet.email/0
    argument :password, constant("password")

    before_build(fn attrs ->
      Map.put(attrs, :hashed_password, AshAuthentication.BcryptProvider.hash(attrs.password))
    end)
  end
```elixir factory MyApp.Accounts.User do attribute :email, &Faker.Internet.email/0 argument :password, constant("password") before_build(fn attrs -> Map.put(attrs, :hashed_password, AshAuthentication.BcryptProvider.hash(attrs.password)) end) end ```
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: james/smokestack#88
No description provided.