railsbuilder 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 311649e88f84c35d430a4b1f24cdca457f92ecd6
4
- data.tar.gz: 535b72090974228bc0a3cc7a1e68557e8162ef4a
3
+ metadata.gz: 6aca3f4e0c2b9ef37e271538bd263f1506017d54
4
+ data.tar.gz: 47b59da00202648b6551e6b89617e1bebea137f7
5
5
  SHA512:
6
- metadata.gz: da3f71bd78cffccd22fb2ec0ee035aa3d9da638801b6bb9f1cdae08b271652f52df491f800eae8f2c3dca40efb5ddd48920bc33414603887f2167bc005e5a977
7
- data.tar.gz: 23e16e223972febb71b427bad4ecaddd0cb610c7e20c3d841871e723f66948eb43cf76ae8a69d80226f67b2d9d3269dcee505f27283b5cd94459466c20065c46
6
+ metadata.gz: 480b3d607489c3b5838ec5df541233a0a46f2f1fa53a845722f79e1036bbade4153ede7c36fb56c5eb871626efe9cd895ad5172fbd31bab385754f9dde26c319
7
+ data.tar.gz: 282823b058cfba278ecbc35463b0c6559a8a754992b3db972ea1fc4450a35b696cd2d68db9baf746fd1cd5b98e6382753e6a849f0cd6124bc2649449e33af87f
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/railsbuilder.rb CHANGED
@@ -116,9 +116,14 @@ class RailsBuilder
116
116
 
117
117
  # if the model fields are defined let's generate the model
118
118
  model = child.element('model_class')
119
+ next unless model
119
120
 
120
121
  class_name = model.attributes[:class_name]
122
+ next unless class_name
123
+
121
124
  attributes = model.xpath('.').map {|x| x.attributes.values}
125
+ next unless attributes.empty?
126
+
122
127
  s = class_name + ' ' + attributes.map{|x| x.join ':'}.join(' ')
123
128
 
124
129
  command = "rails generate model %s" % s
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railsbuilder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file