You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the transition class generated for the mongoid adapter will lead to errors like:
NameError: undefined method `statesman_metadata' for class ...
This is because the include Statesman::Adapters::MongoidTransition tries to alias statesman_metadata, which isn't defined at that point.
A short term fix is to move this line below field :statesman_metadata:
class OrderTransition
include Mongoid::Document
field :to_state, type: String
field :sort_key, type: Integer
field :statesman_metadata, type: Hash
# this has to be after the statesman_metadata declaration
include Statesman::Adapters::MongoidTransition
# ....
Using the transition class generated for the mongoid adapter will lead to errors like:
This is because the
include Statesman::Adapters::MongoidTransition
tries to aliasstatesman_metadata
, which isn't defined at that point.A short term fix is to move this line below
field :statesman_metadata
:A longer term solution could involve declaring the fields in
Statesman::Adapters::MongoidTransition
module, similar to how it is done here: https://github.com/aq1018/mongoid-history/blob/master/lib/mongoid/history/tracker.rb.The text was updated successfully, but these errors were encountered: