Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information