diff --git a/lib/rails_erd/tasks.rake b/lib/rails_erd/tasks.rake index 22e196b1..d50b10eb 100644 --- a/lib/rails_erd/tasks.rake +++ b/lib/rails_erd/tasks.rake @@ -19,7 +19,12 @@ namespace :erd do when "true", "yes" then true when "false", "no" then false when /,/ then ENV[option].split(/\s*,\s*/) - else ENV[option].to_sym + else + if option == 'only' + [ENV[option]] + else + ENV[option].to_sym + end end end end diff --git a/test/unit/rake_task_test.rb b/test/unit/rake_task_test.rb index 6adbe6f0..ca246af1 100644 --- a/test/unit/rake_task_test.rb +++ b/test/unit/rake_task_test.rb @@ -173,4 +173,10 @@ def teardown Rake::Task["erd:options"].execute assert_equal %w[content timestamps], RailsERD.options.attributes end + + test "options task should set single parameter to only as array xxx" do + ENV["only"] = "model" + Rake::Task["erd:options"].execute + assert_equal ["model"], RailsERD.options.only + end end