Skip to content

Initial state doesn't work in Rails 4.2 #334

@kalashnikovisme

Description

@kalashnikovisme

Hi, I have problem with initial state in new Rails 4.2

class User < ActiveRecord::Base
  state_machine initial: :waiting_confirmation do
    state :waiting_confirmation
    state :active
  end
end
Loading development environment (Rails 4.2.0)
[1] pry(main)> User.new.state
=> nil

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions