Demonstrating that source model is reset in save method of repository for new attribute.
-
Copy Example/Catalog module into app/code directory.
-
Install module
./bin/magento module:enable "Example_Catalog" ./bin/magento setup:upgrade ./bin/magento setup:di:compile
-
Run command to create an example product attribute
./bin/magento example:catalog:create_attribute
-
In magento admin panel you should see attribute
example_attribute_code
of input typeselect
having just an empty option. -
Run the command again and you should see the attribute has options from source model.