lib/ymldot.rb in ymldot-0.0.4 vs lib/ymldot.rb in ymldot-0.0.5
- old
+ new
@@ -123,11 +123,13 @@
end
def config_to_dot
res = ""
res << "graph [overlap=false, splines=true]\n"
- res << %Q!graph [size="#{@config["size"]["x"]/2.54},#{@config["size"]["y"]/2.54}"]\n! if @config["size"] && @config["size"]["x"] && @config["size"]["y"]
+ if @config["size"] && @config["size"]["x"] && @config["size"]["y"]
+ res << %Q!graph [size="#{(@config["size"]["x"]/2.54).round},#{(@config["size"]["y"]/2.54).round}"]\n!
+ end
raise "Error: please seto 'font'" if @config["ja"] && @config["font"]
res << %Q!node [fontname="#{@config["font"]}"]! if @config["font"]
res
end
@@ -215,10 +217,10 @@
def eval_relation_polymorphic(keys, tname)
keys.each do |rel|
@entity_dict[tname].foreignkeys << append_fk_str(singularize(rel["name"])) if key = rel["name"]
@entity_dict[tname].columns.unshift "#{singularize(rel["type"])}(type)" if key = rel["type"]
rel["tables"].each do |t|
- @one_relations << {:self => @entity_dict[t], :have => @entity_dict[tname] }
+ @many_relations << {:self => @entity_dict[t], :have => @entity_dict[tname] }
end
end
end
def append_fk_str(key)