Sha256: 5d059be271ca9ef9cb66aeac23272776a7fb3fa9ea844d48a86bc4987683c817

Contents?: true

Size: 1.92 KB

Versions: 8

Compression:

Stored size: 1.92 KB

Contents

# model_base_generators

`model_base_generators` extends generators to use your models effectively.
It uses twitter-bootstrap-rails, rspec, factory_girl and so on.


## Installation

Add this line to your application's Gemfile:

```ruby
gem 'model_base_generators'
```

And then execute:

    $ bundle

## Usage

### 1. Generate your model

```bash
$ bin/rails g model Issue project:references{required} title:string status:integer
```

### 2. Make up your generated migration

Add `:null` option.

```ruby
class CreateIssues < ActiveRecord::Migration[5.0]
  def change
    create_table :issues do |t|
      t.references :project, null: false, foreign_key: true
      t.string :title  , null: false
      t.integer :status, null: false

      t.timestamps
    end
  end
end
```

### 3. Run migration

```bash
$ bin/rails db:migrate
```

### 4. Generate controller and views

```bash
$ bin/rails g scaffold_controller issues
```

Run scaffold_controller **WITHOUT attributes**!



## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/akm/model_base_generators. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.


## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
model_base_generators-0.2.4 README.md
model_base_generators-0.2.3 README.md
model_base_generators-0.2.2 README.md
model_base_generators-0.2.1 README.md
model_base_generators-0.2.0 README.md
model_base_generators-0.1.2 README.md
model_base_generators-0.1.1 README.md
model_base_generators-0.1.0 README.md