Skip to content

Commit

Permalink
Merge pull request #310 from y-yagi/fix_doc_about_generate_model
Browse files Browse the repository at this point in the history
Fix doc about model generator
  • Loading branch information
cllns committed Apr 6, 2017
2 parents 68da722 + 8a637f8 commit 223d67d
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions source/guides/models/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ As first step, we generate the model:
% bundle exec hanami generate model book
create lib/bookshelf/entities/book.rb
create lib/bookshelf/repositories/book_repository.rb
create db/migrations/20170406230335_create_books.rb
create spec/bookshelf/entities/book_spec.rb
create spec/bookshelf/repositories/book_repository_spec.rb
```

The generator gives us an entity, a repository, a migration, and accompanying test files.

This is the generated entity:

```ruby
Expand All @@ -35,13 +38,6 @@ class BookRepository < Hanami::Repository
end
```

Then we generate the migration:

```shell
% bundle exec hanami generate migration create_books
create db/migrations/20161113154510_create_books.rb
```

Let's edit the migration with the following code:

```ruby
Expand Down

0 comments on commit 223d67d

Please sign in to comment.