Duplicating assigned attributes
See original GitHub issueConsider the following factory:
const User = require('models/user');
factory.define('user', User, {
username: factory.sequence(n => `sherlock_${n}`),
name: "Sherlock Holmes",
password: "Password",
passwordConfirmation: function() { return this.password; }
});
I’d expect the following to pass.
factory.build('user', { password: 'secret' })
.then(user => expect(user.passwordConfirmation).to.equal('secret');
The syntax could differ but I think it’s common use case to duplicate (or do something else) on an already assigned attribute.
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
JR50043: Duplicate assigned attribute values can cause ... - IBM
When multiple products have values that are logically the same, using assigned values attributes creates duplication in the ATTRVAL and ATTRVALDESC tables ...
Read more >Duplicate attributes, options and actions (on the same product ...
How to duplicate attributes/options on the same product (Retargert). This is a function to easily assign the options (or a part of them) ......
Read more >How to duplicate atributes | WordPress.org
How to duplicate atributes · 1) Export the current item with your current attribute. · 2) Open the CSV and create a new...
Read more >Duplicating Capability of "Assigned To" and "Owned ... - Jazz.net
I was looking to have two sections on a menu where (1) "Assigned to IT Team" and that would be associated with another...
Read more >How to assign a count of duplicate attribute values to a new ...
Set a group by on the attribute with identical values, then look at the Count attribute output in the Summary. You will then...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @jonatanklosko, the order of execution for these methods is
attrs
->build
->create
. As of now, we just have callbacks forafterBuild
andafterCreate
, hence the callbacks are not executed forattrs
call. I’ll open another issue to have anafterAttrs
callback.I’ve just realised that it’s not invoked after
#attrs
as well.