Coder Social home page Coder Social logo

Comments (5)

qoobaa avatar qoobaa commented on June 16, 2024

Thanks for reporting the issue. I'll try to find some time to look at it (but it may not be easy to reproduce).

from transitions.

Porta avatar Porta commented on June 16, 2024

No problem. Let me know if I can help in any way.

from transitions.

onknows avatar onknows commented on June 16, 2024

Same here. I'm on MySQL 5.1 but I doubt that MySQL version is the problem. The problem is that the initial state is not set. The way it should work is that the first state should be used as initial state. At least that is what I understand from the documentation. Workaround is to specify the initial state in migration as the default value.

from transitions.

qoobaa avatar qoobaa commented on June 16, 2024

I don't use MySQL in my recent projects. Any volunteer to check/fix it?

from transitions.

troessner avatar troessner commented on June 16, 2024

@Porta , @ostraaten I can't reproduce this.
I set up a sample repo so that we can talk about the same thing: https://github.com/troessner/transitions_intial_state_bug

There is one migration with null: false : https://github.com/troessner/transitions_intial_state_bug/blob/master/db/migrate/20120526121122_create_orders.rb
with a very simple model here: https://github.com/troessner/transitions_intial_state_bug/blob/master/app/models/order.rb

In this project the initial state is set:

>> o = Order.new
=> #<Order id: nil, state: "fresh", created_at: nil, updated_at: nil>
>> o.state
=> "fresh"

you can easily see what I mean by:

git clone https://github.com/troessner/transitions_intial_state_bug
cd transitions_intial_state_bug
bundle install
bundle exec db:create db:migrate
rails c

and then do a

Order.new.state

I assume this issue has been fixed with unrelated commits.
I am closing this issue for now until somebody claims that this is still an issue for him and can give me clean instructions on how to reproduce that.

from transitions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.