lib/rails_erd/tasks.rake in rails-erd-0.4.3 vs lib/rails_erd/tasks.rake in rails-erd-0.4.4
- old
+ new
@@ -11,20 +11,20 @@
when /,/ then ENV[option].split(/\s*,\s*/).map(&:to_sym)
else ENV[option].to_sym
end
end
end
-
+
task :load_models do
say "Loading application environment..."
Rake::Task[:environment].invoke
say "Loading code in search of Active Record models..."
Rails.application.eager_load!
-
+
raise "Active Record was not loaded." unless defined? ActiveRecord
end
-
+
task :generate => [:options, :load_models] do
say "Generating Entity-Relationship Diagram for #{ActiveRecord::Base.descendants.length} models..."
require "rails_erd/diagram/graphviz"
file = RailsERD::Diagram::Graphviz.create