Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for bug when parameter to only option is a single model #300

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/rails_erd/tasks.rake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions test/unit/rake_task_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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