Skip to content

Commit

Permalink
fix: migration generator does not change - to _ (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharygolba committed May 18, 2016
1 parent 81cdd21 commit b165576
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/packages/cli/templates/model-migration.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { underscore, pluralize } from 'inflection';
import { pluralize } from 'inflection';

import indent from '../utils/indent';
import underscore from '../../../utils/underscore';

export default (name, attrs = []) => {
const table = pluralize(underscore(name));
Expand All @@ -11,6 +12,8 @@ export default (name, attrs = []) => {
.map(attr => attr.split(':'))
.filter(([, type]) => !/^has-(one|many)$/g.test(type))
.map(([column, type]) => {
column = underscore(column);

if (type === 'belongs-to') {
type = 'integer';
column = `${column}_id`;
Expand Down

0 comments on commit b165576

Please sign in to comment.