mongoid-erd 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/examples/models/hello.rb +1 -0
- data/lib/mongoid_erd.rb +12 -3
- data/mongoid-erd.gemspec +1 -1
- metadata +1 -1
data/examples/models/hello.rb
CHANGED
data/lib/mongoid_erd.rb
CHANGED
@@ -134,9 +134,9 @@ class MongoidErd
|
|
134
134
|
field_.name = "#{rel_} (as #{as_})" if as_
|
135
135
|
self.parse_erd field_, line # parse erd attr and label
|
136
136
|
crt_model.fields << field_
|
137
|
-
|
138
|
-
|
139
|
-
end
|
137
|
+
#if %w[belongs_to embedded_in embeds_one has_one].include? rel_
|
138
|
+
field_.edge = [name_, '', {label: rel_, arrowhead: 'onormal'}]
|
139
|
+
#end
|
140
140
|
end
|
141
141
|
|
142
142
|
# common extension field
|
@@ -154,6 +154,15 @@ class MongoidErd
|
|
154
154
|
self.parse_erd field_, line # parse erd attr and label
|
155
155
|
crt_model.fields << field_
|
156
156
|
end
|
157
|
+
|
158
|
+
if /\s*as_enum\s+\:(?<name_>\w+)\s*\,\s*(?<enum_>[^#]+)/ =~ line
|
159
|
+
field_ = Fields.new
|
160
|
+
field_.name = name_
|
161
|
+
field_.type = "[ENUM] " + enum_
|
162
|
+
self.parse_erd field_, line # parse erd attr and label
|
163
|
+
crt_model.fields << field_
|
164
|
+
end
|
165
|
+
|
157
166
|
end # open and parse one file
|
158
167
|
|
159
168
|
# assign attributes at the last moment
|
data/mongoid-erd.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
|
2
2
|
|
3
|
-
Gem::Specification.new 'mongoid-erd', '0.0.
|
3
|
+
Gem::Specification.new 'mongoid-erd', '0.0.5' do |s|
|
4
4
|
s.executables << "merd"
|
5
5
|
s.description = "Create model diagram graph (ERD graph) in graphviz's dot language"
|
6
6
|
s.summary = "Mongoid ERD diagram creator"
|