轻松实现 ActiveRecord 方案可视化和模型组织
Colorized table info for columns, types, nullables, indexes... and the actual DDL used by the database to create the table. All this and more with ModelProbe!
Add the GEM to your project
bundle add model_probeModelProbe auto initializes in the Rails development environment.
Use in a Rails console
# examples for a User model
User.probe
User.print_model
User.print_fixtureUse with Rails (Rake) tasks
# examples for a User model
bin/rails model_probe:probe[User]
bin/rails model_probe:print_model[User]
bin/rails model_probe:print_fixture[User]Introspect your ActiveRecord models to build a deep understanding of the underlying database structure.
Generate a well organized template for your ActiveRecord model's class definition.
Create fixture stubs to use in the test suite.
Test can be ran using the default rake task or individually.
ruby -Ilib test/model_probe_test.rbCombine with a simple watch program for a simple test runner.
fd --extension rb | entr -c rake暂无开放 Issues,或尚未同步最近议题。