Fixing set_initial_state with Mongoid
Fixing set_initial_state with Mongoid

ActiveModel::Transitions#set_initial_state was not working with mongoid.
It was check for has_attribute?(:state) which returns false if the field
has no value in a mongoid document.

Using respond_to?(:state=) fixes the issue and keeps the behavior.

lksv/transitions,troessner/transitions,ozydingo/transitions