https://github.com/bnadlerjr/domain
Generates models, unit tests & migrations for Rails from SQL Editor files.
https://github.com/bnadlerjr/domain
Last synced: 3 months ago
JSON representation
Generates models, unit tests & migrations for Rails from SQL Editor files.
- Host: GitHub
- URL: https://github.com/bnadlerjr/domain
- Owner: bnadlerjr
- Created: 2010-03-17T01:50:18.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2010-04-24T02:49:49.000Z (about 15 years ago)
- Last Synced: 2025-02-02T15:52:45.038Z (4 months ago)
- Language: Ruby
- Homepage:
- Size: 97.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rdoc
Awesome Lists containing this project
README
= Rails Domain Generator
== Features
* Generates models, unit tests and migrations based on a given XML file
* Handles indexes, some validations
* Handles has_many and belongs_to relationships== Description
Generates models, unit tests and migrations for a domain by parsing an XML
file. Designed to be used at the beginning of a new project where you have a
piece of your domain defined (maybe derived from a set of mockups), it saves
you the trouble of re-defining tables. The XML file is generated using visual
database modeling software or ERP software. Right now only
{SQL Editor}[http://www.malcolmhardie.com/sqleditor] is supported.By default it will generate models, unit tests and migrations for all tables,
but you can pass in specific table name(s) to override this.When generating models, it will also create the method calls to generate the
model joins. Currently, only 'has_many' and 'belongs_to' are supported. It
will also create presence validators for any fields that are marked as required
and uniqueness validators for any fields that are marked as unique. If comments
are given for the table, they will be inserted as RDOC comments before the
model class definition.The generated unit tests rely on Shoulda and assume that it has been installed.
They will also create tests for any presence or uniqueness validations.The generated migrations are the same as the standard migration generator, but
also support default values and string limits defined for the fields. Indexes
are also generated.== Installation
Clone the git repo to a folder where Rails looks for custom generators.For example:
mkdir ~/.rails/generators
cd ~/.rails/generators
git clone git://github.com/thethirdswitch/domain.git
== License
(The MIT License)Copyright (c) 2010 Bob Nadler, Jr.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.