lib/rails_erd/cli.rb in rails-erd-1.5.0 vs lib/rails_erd/cli.rb in rails-erd-1.5.1
- old
+ new
@@ -72,10 +72,15 @@
option :cluster do
long "--cluster"
desc "Display models in subgraphs based on their namespace."
end
+ option :splines do
+ long "--splines=SPLINE_TYPE"
+ desc "Control how edges are represented. See http://www.graphviz.org/doc/info/attrs.html#d:splines for values."
+ end
+
separator ""
separator "Output options:"
option :filename do
long "--filename=FILENAME"
@@ -164,10 +169,13 @@
require environment_path
rescue ::LoadError
puts "Please create a file in '#{environment_path}' that loads your application environment."
raise
end
- Rails.application.eager_load! if defined? Rails
+ if defined? Rails
+ Rails.application.eager_load!
+ Rails.application.config.eager_load_namespaces.each(&:eager_load!)
+ end
rescue TypeError
end
def create_diagram
$stderr.puts "Generating entity-relationship diagram for #{ActiveRecord::Base.descendants.length} models..."