dpn-admin / dpn-server

Implementation of the DPN RESTful API.
Other
3 stars 6 forks source link

More robust seed functionality #142

Closed malakai97 closed 7 years ago

malakai97 commented 7 years ago

This pull request greatly improves the power and robustness of the seed functionality we have. It takes advantage of the seed feature provided by rails.

Previous usage

This is unchanged from before

What's new

The seed operation will now load any seed files in db/seeds/RAILS_ENV-seeds.d, in lexical order. It is somewhat intelligent about loading dependencies before records that rely on them.

The seed operation now provides some output, similar to what the script in the private repo supplied. The operation is now idempotent--it will skip existing records.

This should replace the manual adding of nodes and members that was being done previously.

malakai97 commented 7 years ago

Listed as in progress because I need to update the readme to reflect this, but ready otherwise.

dazza-codes commented 7 years ago

Codacy indicates there are some duplicate blocks in the specs that might be consolidated into a shared_examples block, see