yaddl 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/yaddl.rb +8 -3
  2. data/lib/yaddl/version.rb +1 -1
  3. metadata +1 -1
@@ -161,8 +161,13 @@ class Generator
161
161
 
162
162
  attrs = {}
163
163
  model['attributes'].each do |k,v|
164
- attrs[k] ||= {}
165
- attrs[k]['type'] = v['type'].sub(/yaml|hash|object|cache/i, "text")
164
+ if v['type'] == "references"
165
+ attrs[k+"_id"] ||= {}
166
+ attrs[k+"_id"]['type'] ="integer"
167
+ else
168
+ attrs[k] ||= {}
169
+ attrs[k]['type'] = v['type'].sub(/yaml|hash|object|cache/i, "text")
170
+ end
166
171
  end
167
172
  model['belongs_to'].each do |k,v|
168
173
  attrs[k+"_id"] ||= {}
@@ -198,7 +203,7 @@ class Generator
198
203
  if changes.count > 0
199
204
  index = ""
200
205
  while Dir.glob("#{Rails.root}/db/migrate/*_#{summary}#{v2}#{name.pluralize}#{index}".underscore.downcase+".rb").count > 0
201
- index = 1 if index = ""
206
+ index = 1 if index == ""
202
207
  index += 1
203
208
  end
204
209
 
@@ -1,3 +1,3 @@
1
1
  module Yaddl
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yaddl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: