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

Error: Different defined default values #358

Open
MichaelA59 opened this issue Jul 31, 2018 · 1 comment
Open

Error: Different defined default values #358

MichaelA59 opened this issue Jul 31, 2018 · 1 comment

Comments

@MichaelA59
Copy link

I get the following error in my console.

Both Coach and its :current_joyride_bot_message machine have defined a different default for "current_joyride_bot_message". Use only one or the other for defining defaults to avoid unexpected behaviors.

It's showing up all the time and I don't know why. As you can see below, the default value for this attribute is identical to where the state machine begins, so I don't understand the meaning of this error. I would like to find a way to get rid of it, or if something is truly incorrect here, fix it.

From the Schema for coaches table

t.integer  "current_joyride_bot_message",       default: 1

From Coach model where the state machine resides

state_machine :current_joyride_bot_message, initial: 1 do
    event :next_joyride_step do
      transition 1 => 2, 2 => 3, 3 => 4, 4 => 5, 5 => 6, 6 => 7, 7 => 8, 8 => 9, 9 => 10, 10 => 11, 11 => 12, 12 => 13
    end
  end
@bidva
Copy link

bidva commented Oct 17, 2018

I had the same issue as you and I made the column to be nullable and that fixed the issue

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

No branches or pull requests

2 participants