binda
binda copied to clipboard
Temporary choice remains
Expected behavior
If I create choices from a task I'd expect the temporary choice to disappear and set as default choice only the first choice I explicitly created.
Actual behavior
The temporary choice remains and it's also the default choice.
How to reproduce the issue
If you run this task you should be able to see it
desc "Create a Intro board and relative field settings"
task :create_intro_board => :environment do
if Binda::Board.where(slug: "intro").any?
puts "Intro board already exists"
else
intro = Binda::Structure.create!(
slug: "intro",
name: "Intro",
instance_type: "board"
)
puts "Intro board has been successfully created"
radio_setting = field_group.field_settings.create!(
name: "Text color",
field_type: "radio",
allow_null: false
)
radio_setting.update_attribute("slug", "intro-text-color")
radio_setting.choices.create!(
value: "dark",
label: "Dark"
)
radio_setting.choices.create!(
value: "light",
label: "Light"
)
puts "Intro text color has been successfully created"
puts ""
puts "All done!"
end
end
System configuration
Binda version: 0.1.9
Rails version: 5.1.2
Also it generates a bug when you try to remove the temporary choice from Binda interface.

~You are able to delete the temporary choice only changing the current default choice, save and after reloading you can delete it.~
This generates another bug because temporary choice is deleted but every component/board still contains temporary choice id reference.