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

Fixes tag control multi-value #14382

Merged
merged 1 commit into from
Mar 22, 2017
Merged
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
4 changes: 4 additions & 0 deletions app/models/dialog_field_tag_control.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ def force_single_value=(setting)
options[:force_single_value] = setting
end

def force_multi_value
!single_value?
end

def self.allowed_tag_categories
tag_cats = Classification.where(:show => true, :parent_id => 0, :read_only => false).includes(:tag).to_a

Expand Down
7 changes: 7 additions & 0 deletions spec/models/dialog_field_tag_control_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ def add_entry(cat, options)
expect(@df.single_value?).to be_truthy
end

it "#force_multi_value" do
expect(@df.force_multi_value).to be_truthy

@df.force_single_value = true
expect(@df.force_multi_value).to be_falsey
end

it "#automate_key_name" do
expect(@df.automate_key_name).to eq("Array::dialog_#{@df.name}")
end
Expand Down