Skip to content

Commit

Permalink
Merge pull request #14382 from d-m-u/tagControlMultiFix
Browse files Browse the repository at this point in the history
Fixes tag control multi-value
(cherry picked from commit b9de782)

https://bugzilla.redhat.com/show_bug.cgi?id=1436223
  • Loading branch information
gmcculloug authored and simaishi committed Mar 27, 2017
1 parent 41721b4 commit ab0b9c9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
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

0 comments on commit ab0b9c9

Please sign in to comment.