Skip to content
This repository has been archived by the owner on Jul 19, 2021. It is now read-only.

Radio button has 2 choices #200

Open
a-barbieri opened this issue Jul 10, 2018 · 1 comment
Open

Radio button has 2 choices #200

a-barbieri opened this issue Jul 10, 2018 · 1 comment
Labels

Comments

@a-barbieri
Copy link
Collaborator

Expected behavior

I'd expect a Radio button to have 1 choice.

Actual behavior

Radio button has 2 choices.

How to reproduce the issue

The current issue happens on a repeater. Haven't tried on components.

  1. Create a structure with a repeater field with nothing in it.
  2. Create some components from that structure and add few repeater instances.
  3. Go back to the structure and create a new radio field inside the repeater
  4. Save and refresh
  5. Modify the radio field choices updating the temporary choice with a different name (say final choice with value final)
  6. Now open Rails console and select one component and get the choices related to the radio of the first repeater.
    Binda::Radio.where(
        field_setting_id: "your-radio-field-setting-id",
        fieldable_id: Binda::Repeater.where(
            field_setting_id: "your-repeater-field-setting-id", 
            fieldable_id: Binda::Component.where(structure_id: "your-structure-id").first
        )
    ).first.choices.map(&:value)
    # => ["final", "final"]

If then I assign a choice manually the same query returns just one value.

System configuration

Binda version: 0.1.9

Rails version: 5.1.4

@a-barbieri a-barbieri added the bug label Jul 10, 2018
@a-barbieri
Copy link
Collaborator Author

Apparently it's possible to assign multiple choices (as many as you wnat) via Rails Console. This shouldn't be possible...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant